summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_uptime_reporter.cpp
diff options
context:
space:
mode:
authorKshitij Gupta <kshitij.gupta@mongodb.com>2022-01-17 19:35:13 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-03 06:34:22 +0000
commit1d8aaed7f9286ce90317d03fc1815bb58b43e31d (patch)
treec0ef354434941aa446bad53f9b9f10741c1c2fe3 /src/mongo/s/sharding_uptime_reporter.cpp
parent3b73633480220630507435a4edc3fb141739e93c (diff)
downloadmongo-1d8aaed7f9286ce90317d03fc1815bb58b43e31d.tar.gz
SERVER-59384: Should provide ability to perform periodic DNS health checks
Diffstat (limited to 'src/mongo/s/sharding_uptime_reporter.cpp')
-rw-r--r--src/mongo/s/sharding_uptime_reporter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp
index 31fd4bc6162..a12d4d84e73 100644
--- a/src/mongo/s/sharding_uptime_reporter.cpp
+++ b/src/mongo/s/sharding_uptime_reporter.cpp
@@ -75,8 +75,10 @@ void reportStatus(OperationContext* opCtx,
// balancer is never active in mongos. Here for backwards compatibility only.
mType.setWaiting(true);
mType.setMongoVersion(VersionInfoInterface::instance().version().toString());
- mType.setAdvisoryHostFQDNs(
- getHostFQDNs(hostName, HostnameCanonicalizationMode::kForwardAndReverse));
+ auto statusWith = getHostFQDNs(hostName, HostnameCanonicalizationMode::kForwardAndReverse);
+ if (statusWith.isOK()) {
+ mType.setAdvisoryHostFQDNs(statusWith.getValue());
+ }
try {
// Field "created" should not be updated every time.