summaryrefslogtreecommitdiff
path: root/src/mongo/executor/network_interface_asio_command.cpp
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2016-12-12 15:22:01 -0500
committerJason Carey <jcarey@argv.me>2016-12-13 16:09:47 -0500
commit5e103c4f5583e2566a45d740225dc250baacfbd7 (patch)
treebc23152b120a3ed38c453bd42cd04fff09e9e94a /src/mongo/executor/network_interface_asio_command.cpp
parent63fa79b30347475962f1ca7ba8858c57baf33925 (diff)
SERVER-27388 Add NetworkInterfaceExceededTimeLimitr3.4.1-rc0r3.4.1
max_time_ms_sharded.js uses a fail point to trigger immediate ExceededTimeLimit returns from commands. This triggers during connection establishment via the connection hook, which returns ExceededTimeLimit to the connection pool and causes us to spin on connection creation. The fix involves providing our own internal exceeded time limit that doesn't collide with the remote value. (cherry picked from commit 5d32ae99ab086e696bc9c5610c9f93220481e596)
Diffstat (limited to 'src/mongo/executor/network_interface_asio_command.cpp')
-rw-r--r--src/mongo/executor/network_interface_asio_command.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/executor/network_interface_asio_command.cpp b/src/mongo/executor/network_interface_asio_command.cpp
index 036b2954ee0..c72a7b74505 100644
--- a/src/mongo/executor/network_interface_asio_command.cpp
+++ b/src/mongo/executor/network_interface_asio_command.cpp
@@ -283,7 +283,8 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, ResponseStatus resp)
op->_timeoutAlarm->cancel();
}
- if (resp.status.code() == ErrorCodes::ExceededTimeLimit) {
+ if (resp.status.code() == ErrorCodes::ExceededTimeLimit ||
+ resp.status.code() == ErrorCodes::NetworkInterfaceExceededTimeLimit) {
_numTimedOutOps.fetchAndAdd(1);
}
@@ -293,7 +294,7 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, ResponseStatus resp)
// If we fail during connection, we won't be able to access any of op's members after
// calling finish(), so we return here.
log() << "Failed to connect to " << op->request().target << " - " << resp.status;
- op->finish(resp);
+ op->finish(std::move(resp));
return;
}
@@ -305,7 +306,7 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, ResponseStatus resp)
log() << "Failed asio heartbeat to " << op->request().target << " - "
<< redact(resp.status);
_numFailedOps.fetchAndAdd(1);
- op->finish(resp);
+ op->finish(std::move(resp));
return;
}
@@ -337,7 +338,7 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, ResponseStatus resp)
_inProgress.erase(iter);
}
- op->finish(resp);
+ op->finish(std::move(resp));
MONGO_ASIO_INVARIANT(static_cast<bool>(ownedOp), "Invalid AsyncOp", op);