cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.72k stars 434 forks source link

*: improve leak detection UX for iters, DBs #2032

Open nicktrav opened 1 year ago

nicktrav commented 1 year ago

We've run into a few issues caused by various types of "leak" - e.g. failure to close an iterator, failure to decrement a ref count, which can create a resource leak (file, memory, etc.).

It would be nice to have some general mechanism for asserting that an iterator / DB is closed. This is especially useful in testing (both unit and metamorphic tests).

I'm thinking of something like we have already in Cockroach - a defer that runs a leak check (example). The UX could be improved there, but that might be a good starting point.

Jira issue: PEBBLE-140

nicktrav commented 1 year ago

Action item here could be to go through the various "entities" (snapshots, table cache, etc.) to check that we have assertions in place.

github-actions[bot] commented 4 months ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to Pebble!