summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-05-29 10:34:16 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-29 16:12:43 +0000
commitfa72353e2da4f9f5c7c61d042deb2e9d7a1bcf05 (patch)
tree9e931bec0f033d066b22140e1c7fab3ab888a69e
parentc28892ddb597e2875cda52dcf35810b7395c7dc1 (diff)
downloadmongo-fa72353e2da4f9f5c7c61d042deb2e9d7a1bcf05.tar.gz
SERVER-48384 Make PeriodicJob stop before TimestampMonitor destroy its members
-rw-r--r--src/mongo/db/storage/storage_engine_impl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/storage/storage_engine_impl.h b/src/mongo/db/storage/storage_engine_impl.h
index 99ef111f70f..7110af07951 100644
--- a/src/mongo/db/storage/storage_engine_impl.h
+++ b/src/mongo/db/storage/storage_engine_impl.h
@@ -283,11 +283,13 @@ public:
KVEngine* _engine;
bool _running;
- PeriodicJobAnchor _job;
// The set of timestamps that were last reported to the listeners by the monitor.
MonitoredTimestamps _currentTimestamps;
+ // Periodic runner that the timestamp monitor schedules its job on.
+ PeriodicRunner* _periodicRunner;
+
// Protects access to _listeners below.
Mutex _monitorMutex = MONGO_MAKE_LATCH("TimestampMonitor::_monitorMutex");
std::vector<TimestampListener*> _listeners;
@@ -297,7 +299,7 @@ public:
// when the class instance is being deconstructed. This causes the PeriodicJobAnchor to stop
// the PeriodicJob, preventing us from accessing any destructed variables if this were to
// run during the destruction of this class instance.
- PeriodicRunner* _periodicRunner;
+ PeriodicJobAnchor _job;
};
StorageEngine* getStorageEngine() override {