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 20:04:54 +0000
commitbe91369d8477a9b98035b00c7b1129b352aedb75 (patch)
tree160242040bd2fd08c9b91c174284808cc774b88c
parentf9df74846d8fd8e9c9530d0b53df4a222c255378 (diff)
downloadmongo-be91369d8477a9b98035b00c7b1129b352aedb75.tar.gz
SERVER-48493 RSM's isMasterMonitor should handle network exceeded time limit errors
(cherry picked from commit aaaa9e31cd21a06f62e4c8576ab078c869a13d8f)
-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 4f517ddb73e..ad360946436 100644
--- a/src/mongo/client/server_is_master_monitor.cpp
+++ b/src/mongo/client/server_is_master_monitor.cpp
@@ -192,6 +192,7 @@ void SingleServerIsMasterMonitor::_scheduleNextIsMaster(WithLock, Milliseconds d
if (!cbData.status.isOK()) {
return;
}
+
self->_doRemoteCommand();
});
@@ -209,10 +210,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 f1a6e008782..19a36482d04 100644
--- a/src/mongo/executor/network_interface.h
+++ b/src/mongo/executor/network_interface.h
@@ -149,6 +149,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,