summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_uptime_reporter.cpp
diff options
context:
space:
mode:
authorJason Zhang <jason.zhang@mongodb.com>2020-11-23 21:26:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-03 01:43:28 +0000
commit94864589ce3f349b35ed3ca1597767c0747ab72a (patch)
tree886f57981771fdc1d12b92abb7d9dcb4b37219a9 /src/mongo/s/sharding_uptime_reporter.cpp
parent056b253876ee570b5f14c469b8fded9c85b45b50 (diff)
downloadmongo-94864589ce3f349b35ed3ca1597767c0747ab72a.tar.gz
SERVER-51775 Failpoint to disable periodic uptime reporter thread should instead just disable uptime reporting
Diffstat (limited to 'src/mongo/s/sharding_uptime_reporter.cpp')
-rw-r--r--src/mongo/s/sharding_uptime_reporter.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp
index df681077115..0a0455975b2 100644
--- a/src/mongo/s/sharding_uptime_reporter.cpp
+++ b/src/mongo/s/sharding_uptime_reporter.cpp
@@ -50,7 +50,7 @@
namespace mongo {
namespace {
-MONGO_FAIL_POINT_DEFINE(disableShardingUptimeReporterPeriodicThread);
+MONGO_FAIL_POINT_DEFINE(disableShardingUptimeReporting);
const Seconds kUptimeReportInterval(10);
@@ -112,14 +112,15 @@ void ShardingUptimeReporter::startPeriodicThread() {
const Timer upTimeTimer;
while (!globalInShutdownDeprecated()) {
- if (MONGO_unlikely(disableShardingUptimeReporterPeriodicThread.shouldFail())) {
- LOGV2(426322,
- "The sharding uptime reporter periodic thread is disabled for testing");
- return;
- }
{
auto opCtx = cc().makeOperationContext();
- reportStatus(opCtx.get(), instanceId, hostName, upTimeTimer);
+
+ if (MONGO_unlikely(disableShardingUptimeReporting.shouldFail())) {
+ LOGV2(426322,
+ "Disabling the reporting of the uptime status for the current instance.");
+ } else {
+ reportStatus(opCtx.get(), instanceId, hostName, upTimeTimer);
+ }
auto status = Grid::get(opCtx.get())
->getBalancerConfiguration()