diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2020-04-02 15:04:51 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-06 21:58:35 +0000 |
commit | ab0d153626c24173f0ea9a26610c02ffc51d9420 (patch) | |
tree | 69f7e090c6713624aeefacb6b3236e8b5225cf9f /src/mongo/executor | |
parent | 8ebe78a87142137172358290b9da6551db3ae322 (diff) | |
download | mongo-ab0d153626c24173f0ea9a26610c02ffc51d9420.tar.gz |
SERVER-47352 Return connections inline for NetworkInterfaceTL
Diffstat (limited to 'src/mongo/executor')
-rw-r--r-- | src/mongo/executor/network_interface_tl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/executor/network_interface_tl.cpp b/src/mongo/executor/network_interface_tl.cpp index 506825ee69b..1b26c4ecdbd 100644 --- a/src/mongo/executor/network_interface_tl.cpp +++ b/src/mongo/executor/network_interface_tl.cpp @@ -776,16 +776,16 @@ void NetworkInterfaceTL::RequestState::resolve(Future<RemoteCommandResponse> fut .onError([this, anchor = shared_from_this()](Status error) { // The RCRq failed, wrap the error into a RCRsp with the host and duration return RemoteCommandOnAnyResponse(host, std::move(error), stopwatch.elapsed()); + }) + .tapAll([ this, anchor = shared_from_this() ](const auto& swr) noexcept { + invariant(swr.isOK()); + returnConnection(swr.getValue().status); }); std::move(anyFuture) // .thenRunOn(makeGuaranteedExecutor(baton, reactor)) // Switch to the baton/reactor. .getAsync([ this, anchor = shared_from_this() ](auto swr) noexcept { - auto response = uassertStatusOK(swr); - auto status = response.status; - - returnConnection(status); - + auto response = uassertStatusOK(std::move(swr)); auto commandStatus = getStatusFromCommandResult(response.data); if (!cmdState->finishLine.arriveStrongly()) { |