summaryrefslogtreecommitdiff
path: root/src/mongo/executor
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@10gen.com>2020-04-02 15:04:51 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-06 21:58:35 +0000
commitab0d153626c24173f0ea9a26610c02ffc51d9420 (patch)
tree69f7e090c6713624aeefacb6b3236e8b5225cf9f /src/mongo/executor
parent8ebe78a87142137172358290b9da6551db3ae322 (diff)
downloadmongo-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.cpp10
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()) {