summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_manager.h
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-07-15 22:56:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-21 17:39:48 +0000
commit0cb70e9577c46257798d0385b15ec6bff8dbd28d (patch)
treea81a6efea5ce32e67a5e0193d08e0d69c05305bf /src/mongo/db/keys_collection_manager.h
parenta7548e3f0b558d5a8bb936751402cfa0601c34cc (diff)
downloadmongo-0cb70e9577c46257798d0385b15ec6bff8dbd28d.tar.gz
SERVER-48709 Fix overflow in key manager wake up calculation
Diffstat (limited to 'src/mongo/db/keys_collection_manager.h')
-rw-r--r--src/mongo/db/keys_collection_manager.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/keys_collection_manager.h b/src/mongo/db/keys_collection_manager.h
index 751de346ef0..0fe5ee6f732 100644
--- a/src/mongo/db/keys_collection_manager.h
+++ b/src/mongo/db/keys_collection_manager.h
@@ -50,6 +50,17 @@ class LogicalTime;
class ServiceContext;
class KeysCollectionClient;
+namespace keys_collection_manager_util {
+
+/**
+ * Returns the amount of time to wait until the monitoring thread should attempt to refresh again.
+ */
+Milliseconds howMuchSleepNeedFor(const LogicalTime& currentTime,
+ const LogicalTime& latestExpiredAt,
+ const Milliseconds& interval);
+
+} // namespace keys_collection_manager_util
+
/**
* The KeysCollectionManager queries the config servers for keys that can be used for
* HMAC computation. It maintains an internal background thread that is used to periodically