diff options
author | Jason Carey <jcarey@argv.me> | 2018-03-21 00:15:35 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2018-04-27 19:49:28 -0400 |
commit | 4ddf18bcf4d517c3dc0f005f9222ffaab9a86ffa (patch) | |
tree | 438865c1065d0a96c427b1ed3a89e5163d85699a /src/mongo/executor/network_interface_asio.cpp | |
parent | 91eaa878c4feeebd9397c49180631fc719238aaf (diff) | |
download | mongo-4ddf18bcf4d517c3dc0f005f9222ffaab9a86ffa.tar.gz |
SERVER-34739 Migrate to 1 connpool in ARS
Migrate to 1 connection pool in mongos.
This change involves the introduction of a transport layer baton, which
improves perf for a particular transport layer when doing local
scatter/gather operations.
Diffstat (limited to 'src/mongo/executor/network_interface_asio.cpp')
-rw-r--r-- | src/mongo/executor/network_interface_asio.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/executor/network_interface_asio.cpp b/src/mongo/executor/network_interface_asio.cpp index 9fe1c9da4da..8d74d56656f 100644 --- a/src/mongo/executor/network_interface_asio.cpp +++ b/src/mongo/executor/network_interface_asio.cpp @@ -250,7 +250,8 @@ Status attachMetadataIfNeeded(RemoteCommandRequest& request, Status NetworkInterfaceASIO::startCommand(const TaskExecutor::CallbackHandle& cbHandle, RemoteCommandRequest& request, - const RemoteCommandCompletionFn& onFinish) { + const RemoteCommandCompletionFn& onFinish, + const transport::BatonHandle& baton) { MONGO_ASIO_INVARIANT(onFinish, "Invalid completion function"); { stdx::lock_guard<stdx::mutex> lk(_inProgressMutex); @@ -422,7 +423,8 @@ Status NetworkInterfaceASIO::startCommand(const TaskExecutor::CallbackHandle& cb return Status::OK(); } -void NetworkInterfaceASIO::cancelCommand(const TaskExecutor::CallbackHandle& cbHandle) { +void NetworkInterfaceASIO::cancelCommand(const TaskExecutor::CallbackHandle& cbHandle, + const transport::BatonHandle& baton) { stdx::lock_guard<stdx::mutex> lk(_inProgressMutex); // If we found a matching cbHandle in _inGetConnection, then @@ -447,7 +449,9 @@ void NetworkInterfaceASIO::cancelCommand(const TaskExecutor::CallbackHandle& cbH } } -Status NetworkInterfaceASIO::setAlarm(Date_t when, const stdx::function<void()>& action) { +Status NetworkInterfaceASIO::setAlarm(Date_t when, + const stdx::function<void()>& action, + const transport::BatonHandle& baton) { if (inShutdown()) { return {ErrorCodes::ShutdownInProgress, "NetworkInterfaceASIO shutdown in progress"}; } @@ -462,12 +466,12 @@ Status NetworkInterfaceASIO::setAlarm(Date_t when, const stdx::function<void()>& return exceptionToStatus(); } - alarm->async_wait([alarm, this, action, when](std::error_code ec) { + alarm->async_wait([alarm, this, action, when, baton](std::error_code ec) { const auto nowValue = now(); if (nowValue < when) { warning() << "ASIO alarm returned early. Expected at: " << when << ", fired at: " << nowValue; - const auto status = setAlarm(when, action); + const auto status = setAlarm(when, action, baton); if ((!status.isOK()) && (status.code() != ErrorCodes::ShutdownInProgress)) { fassertFailedWithStatus(40383, status); } |