summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2020-05-29 15:41:51 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-03 18:02:22 +0000
commitaaaa9e31cd21a06f62e4c8576ab078c869a13d8f (patch)
tree17462552dbbe853164113eedc0df4ea07ac8dc88
parentd1cb83d9199c1a25158d74e47b3aa88b5c33fe8b (diff)
downloadmongo-aaaa9e31cd21a06f62e4c8576ab078c869a13d8f.tar.gz
SERVER-48493 RSM's isMasterMonitor should handle network exceeded time limit errors
-rw-r--r--src/mongo/client/server_is_master_monitor.cpp11
-rw-r--r--src/mongo/executor/network_interface.h2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/client/server_is_master_monitor.cpp b/src/mongo/client/server_is_master_monitor.cpp
index e9c84f1aaaa..321bffca176 100644
--- a/src/mongo/client/server_is_master_monitor.cpp
+++ b/src/mongo/client/server_is_master_monitor.cpp
@@ -193,6 +193,7 @@ void SingleServerIsMasterMonitor::_scheduleNextIsMaster(WithLock, Milliseconds d
if (!cbData.status.isOK()) {
return;
}
+
self->_doRemoteCommand();
});
@@ -210,10 +211,14 @@ void SingleServerIsMasterMonitor::_doRemoteCommand() {
return;
StatusWith<executor::TaskExecutor::CallbackHandle> swCbHandle = [&]() {
- if (exhaustEnabled(_topologyVersion)) {
- return _scheduleStreamableIsMaster();
+ try {
+ if (exhaustEnabled(_topologyVersion)) {
+ return _scheduleStreamableIsMaster();
+ }
+ return _scheduleSingleIsMaster();
+ } catch (ExceptionFor<ErrorCodes::NetworkInterfaceExceededTimeLimit>& ex) {
+ return StatusWith<executor::TaskExecutor::CallbackHandle>(ex.toStatus());
}
- return _scheduleSingleIsMaster();
}();
if (!swCbHandle.isOK()) {
diff --git a/src/mongo/executor/network_interface.h b/src/mongo/executor/network_interface.h
index d7aaae4c69f..5d59265e250 100644
--- a/src/mongo/executor/network_interface.h
+++ b/src/mongo/executor/network_interface.h
@@ -152,6 +152,8 @@ public:
*
* Note that if you pass a baton to startCommand and that baton refuses work, then your onFinish
* function will not run.
+ *
+ * These methods may throw.
*/
virtual Status startCommand(const TaskExecutor::CallbackHandle& cbHandle,
RemoteCommandRequestOnAny& request,