scitokens / scitokens-cpp

A C++ implementation of the SciTokens library with a C library interface
Apache License 2.0
5 stars 22 forks source link

fix apparent fd-leak of sqlite handle #87

Closed edquist closed 2 years ago

edquist commented 2 years ago

(attn: @brianhlin @djw8605, i don't have permissions to assign a reviewer for this)

I'm seeing condor_schedd accumulating open fds pointing to /var/lib/condor/.cache/scitokens/scitokens_cpp.sqllite (thousands), without ever getting closed.

I looked around the sources here and every other return in a function that opens this db is preceeded by a sqlite3_close(db); . Presumably this one here is the source of the leak and just got missed.

djw8605 commented 2 years ago

Do you potentially see an issue with the line here: https://github.com/scitokens/scitokens-cpp/blob/bddd5f0edf3ad070bfe8255f8c73a8eb7fd77460/src/scitokens_cache.cpp#L117

edquist commented 2 years ago

Do you potentially see an issue with the line here

No, i do not, though admittedly I'm new to this codebase.

In particular,

... let me know if you see something though!