diff options
| author | Jason Carey <jcarey@argv.me> | 2016-12-12 15:22:01 -0500 |
|---|---|---|
| committer | Jason Carey <jcarey@argv.me> | 2016-12-13 16:09:47 -0500 |
| commit | 5e103c4f5583e2566a45d740225dc250baacfbd7 (patch) | |
| tree | bc23152b120a3ed38c453bd42cd04fff09e9e94a /src/mongo/executor/network_interface_asio.cpp | |
| parent | 63fa79b30347475962f1ca7ba8858c57baf33925 (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.cpp')
| -rw-r--r-- | src/mongo/executor/network_interface_asio.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/executor/network_interface_asio.cpp b/src/mongo/executor/network_interface_asio.cpp index 74e677acb6d..1fec733704d 100644 --- a/src/mongo/executor/network_interface_asio.cpp +++ b/src/mongo/executor/network_interface_asio.cpp @@ -287,6 +287,9 @@ Status NetworkInterfaceASIO::startCommand(const TaskExecutor::CallbackHandle& cb Status status = wasPreviouslyCanceled ? Status(ErrorCodes::CallbackCanceled, "Callback canceled") : swConn.getStatus(); + if (status.code() == ErrorCodes::NetworkInterfaceExceededTimeLimit) { + status = Status(ErrorCodes::ExceededTimeLimit, status.reason()); + } if (status.code() == ErrorCodes::ExceededTimeLimit) { _numTimedOutOps.fetchAndAdd(1); } @@ -363,8 +366,9 @@ Status NetworkInterfaceASIO::startCommand(const TaskExecutor::CallbackHandle& cb msg << "Remote command timed out while waiting to get a connection from the " << "pool, took " << getConnectionDuration << ", timeout was set to " << timeout; - auto rs = ResponseStatus( - ErrorCodes::ExceededTimeLimit, msg.str(), getConnectionDuration); + auto rs = ResponseStatus(ErrorCodes::NetworkInterfaceExceededTimeLimit, + msg.str(), + getConnectionDuration); return _completeOperation(op, rs); } |
