diff options
author | Andrew Shuvalov <andrew.shuvalov@mongodb.com> | 2022-01-05 01:38:11 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-05 02:17:57 +0000 |
commit | fab9d1e756563e5377bb8a746011f3c08fefeb5b (patch) | |
tree | b7e98c10219ac860db7808523506df71b79d4d0b | |
parent | 5c76d29f4c21fbfe151b858b70f3b555840a2362 (diff) | |
download | mongo-fab9d1e756563e5377bb8a746011f3c08fefeb5b.tar.gz |
SERVER-62357 Increase the default health check progress monitor interval
-rw-r--r-- | jstests/sharding/health_monitor/parameters.js | 2 | ||||
-rw-r--r-- | src/mongo/db/process_health/health_monitoring_server_parameters.idl | 2 | ||||
-rw-r--r-- | src/mongo/db/process_health/progress_monitor.cpp | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/jstests/sharding/health_monitor/parameters.js b/jstests/sharding/health_monitor/parameters.js index a375ee89b7e..b73eb8f5446 100644 --- a/jstests/sharding/health_monitor/parameters.js +++ b/jstests/sharding/health_monitor/parameters.js @@ -143,7 +143,7 @@ assert.commandWorked(st.s1.adminCommand( result = st.s1.adminCommand({"getParameter": 1, "progressMonitor": 1}); assert.eq(result.progressMonitor.deadline, CUSTOM_DEADLINE + 1); // Setting only one sub-field will reset others to their default. -assert.eq(result.progressMonitor.interval, 50); +assert.eq(result.progressMonitor.interval, 1000); assert.commandWorked(st.s1.adminCommand({ "setParameter": 1, diff --git a/src/mongo/db/process_health/health_monitoring_server_parameters.idl b/src/mongo/db/process_health/health_monitoring_server_parameters.idl index 33120033e35..d4690788095 100644 --- a/src/mongo/db/process_health/health_monitoring_server_parameters.idl +++ b/src/mongo/db/process_health/health_monitoring_server_parameters.idl @@ -100,7 +100,7 @@ structs: interval: description: "Interval between liveness checks in milliseconds." type: int - default: 50 + default: 1000 validator: { gt: 0 } deadline: description: "Deadline for liveness checks, after which process should exit, in seconds." diff --git a/src/mongo/db/process_health/progress_monitor.cpp b/src/mongo/db/process_health/progress_monitor.cpp index 9b461106843..d1d1ec13f47 100644 --- a/src/mongo/db/process_health/progress_monitor.cpp +++ b/src/mongo/db/process_health/progress_monitor.cpp @@ -124,11 +124,17 @@ void ProgressMonitor::progressMonitorCheck(std::function<void(std::string cause) void ProgressMonitor::_progressMonitorLoop() { Client::initThread("FaultManagerProgressMonitor"_sd, _svcCtx, nullptr); + static const int kSleepsPerInterval = 10; while (!_terminate.load()) { progressMonitorCheck(_crashCb); - sleepFor(_faultManager->getConfig().getPeriodicLivenessCheckInterval()); + const auto interval = + Microseconds(_faultManager->getConfig().getPeriodicLivenessCheckInterval()); + // Breaking up the sleeping interval to check for `_terminate` more often. + for (int i = 0; i < kSleepsPerInterval && !_terminate.load(); ++i) { + sleepFor(interval / kSleepsPerInterval); + } } } |