The new cleanup order helps identify the write Rock entry state (reading or
writing) and avoid assertions related to state identification bugs (such
as unlocking a writing entry for reading).
Similar to the memory cache code, we should not disconnect disk entries during
shutdown because Store::Root() may be missing by then.
StoreEntry::~StoreEntry()
{
- if (swap_filen >= 0) {
- SwapDir &sd = dynamic_cast<SwapDir&>(*store());
- sd.disconnect(*this);
- }
}
#if USE_ADAPTATION
if (e == NullStoreEntry::getInstance())
return;
+ // Store::Root() is FATALly missing during shutdown
+ if (e->swap_filen >= 0 && !shutting_down) {
+ SwapDir &sd = dynamic_cast<SwapDir&>(*e->store());
+ sd.disconnect(*e);
+ }
+
e->destroyMemObject();
e->hashDelete();