mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
3bafd20a06
Summary: This contains several fixes to LocalStore handling during shutdown. - Have EdenServer explicitly call localStore_->close() during shutdown. This ensures that the local store really gets close, just in case some other part of the code somehow still has an outstanding shared_ptr reference to it. - Add synchronization around internal access to the RocksDB object in RocksDbLocalStore. This ensures that calling `close()` is safe even if there happens to still be some outstanding I/O operations. In particular this helps ensure that if background GC operation is in progress that `close()` will wait until it completes before destroying the DB object. This also improves the code so that calling subsequent methods on a closed RocksDbLocalStore throws an exception, instead of simply crashing. I don't believe the additional synchronization in RocksDbLocalStore should have much impact on performance: the synchronization overhead should be very low compared to the cost of the RocksDB reads/writes. Ideally some of this synchronization logic should perhaps be moved into the base `LocalStore` class: all of the different `LocalStore` implementations should ideally ensure that `close()` is thread-safe and blocks until other pending I/O operations are complete. However, that requires a bigger refactoring. I may attempt that in a subsequent diff, but for now I mainly want to address this problem just for RocksDbLocalStore. Reviewed By: strager Differential Revision: D15948382 fbshipit-source-id: 96d633ac0879b3321f596224907fcfe72691b3f0 |
||
---|---|---|
.. | ||
git | ||
hg | ||
mononoke | ||
test | ||
BackingStore.h | ||
BlobAccess.cpp | ||
BlobAccess.h | ||
BlobCache.cpp | ||
BlobCache.h | ||
BlobMetadata.h | ||
CMakeLists.txt | ||
Diff.cpp | ||
Diff.h | ||
eden_store_util.cpp | ||
EmptyBackingStore.cpp | ||
EmptyBackingStore.h | ||
IObjectStore.h | ||
KeySpaces.h | ||
LocalStore.cpp | ||
LocalStore.h | ||
MemoryLocalStore.cpp | ||
MemoryLocalStore.h | ||
ObjectStore.cpp | ||
ObjectStore.h | ||
RocksDbLocalStore.cpp | ||
RocksDbLocalStore.h | ||
SerializedBlobMetadata.cpp | ||
SerializedBlobMetadata.h | ||
SqliteLocalStore.cpp | ||
SqliteLocalStore.h | ||
StoreResult.cpp | ||
StoreResult.h |