Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
173 stars 8 forks source link

Cancel all background work on last reference drop #98

Closed GodTamIt closed 9 months ago

GodTamIt commented 9 months ago

This cancels all background work before dropping the last reference to prevent background work from keeping the database open.

GodTamIt commented 9 months ago

@Congyuwang mind taking a look at this? This seems to be causing some subtle races in certain use-cases where background threads continue mutating the RocksDB after all references have been close()d and something else tries to upload or otherwise read the database directory.