diff --git a/db/db_impl.cc b/db/db_impl.cc index 65e8e437c1c5bda0cc88cfb4d6c8e3a6f13caca9..ca91b5e82a7950dccd51d157591eeb0689f57e20 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1924,6 +1924,10 @@ void DBImpl::BackgroundCallFlush() { MaybeScheduleFlushOrCompaction(); } bg_cv_.SignalAll(); + // IMPORTANT: there should be no code after calling SignalAll. This call may + // signal the DB destructor that it's OK to proceed with destruction. In + // that case, all DB variables will be dealloacated and referencing them + // will cause trouble. } log_buffer.FlushBufferToLog(); } @@ -1993,6 +1997,10 @@ void DBImpl::BackgroundCallCompaction() { MaybeScheduleFlushOrCompaction(); } bg_cv_.SignalAll(); + // IMPORTANT: there should be no code after calling SignalAll. This call may + // signal the DB destructor that it's OK to proceed with destruction. In + // that case, all DB variables will be dealloacated and referencing them + // will cause trouble. } log_buffer.FlushBufferToLog(); }