summaryrefslogtreecommitdiff
path: root/src/mongo/executor/network_interface_tl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/executor/network_interface_tl.h')
-rw-r--r--src/mongo/executor/network_interface_tl.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mongo/executor/network_interface_tl.h b/src/mongo/executor/network_interface_tl.h
index d6f50032111..2ab75f49aaa 100644
--- a/src/mongo/executor/network_interface_tl.h
+++ b/src/mongo/executor/network_interface_tl.h
@@ -97,7 +97,17 @@ private:
Date_t deadline = RemoteCommandRequest::kNoExpirationDate;
Date_t start;
- ConnectionPool::ConnectionHandle conn;
+ struct Deleter {
+ ConnectionPool::ConnectionHandleDeleter returner;
+ transport::ReactorHandle reactor;
+
+ void operator()(ConnectionPool::ConnectionInterface* ptr) const {
+ reactor->dispatch([ ret = returner, ptr ](auto) { ret(ptr); });
+ }
+ };
+ using ConnHandle = std::unique_ptr<ConnectionPool::ConnectionInterface, Deleter>;
+
+ ConnHandle conn;
std::unique_ptr<transport::ReactorTimer> timer;
AtomicWord<bool> done;
@@ -128,7 +138,7 @@ private:
void _eraseInUseConn(const TaskExecutor::CallbackHandle& handle);
Future<RemoteCommandResponse> _onAcquireConn(std::shared_ptr<CommandState> state,
Future<RemoteCommandResponse> future,
- ConnectionPool::ConnectionHandle conn,
+ CommandState::ConnHandle conn,
const BatonHandle& baton);
std::string _instanceName;