diff options
-rw-r--r-- | src/mongo/s/async_requests_sender.cpp | 10 | ||||
-rw-r--r-- | src/mongo/transport/baton_asio_linux.h | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/s/async_requests_sender.cpp b/src/mongo/s/async_requests_sender.cpp index 6150346a15b..c776bdc2420 100644 --- a/src/mongo/s/async_requests_sender.cpp +++ b/src/mongo/s/async_requests_sender.cpp @@ -299,14 +299,8 @@ Status AsyncRequestsSender::RemoteData::resolveShardIdToHostAndPort( str::stream() << "Could not find shard " << shardId); } - // It shouldn't be necessary to run without interruption here, but there's a subtle race around - // exiting early while callbacks hold a reference to this type. The easiest way to work around - // it is to unconditionally block in targeting (for now). - auto findHostStatus = ars->_opCtx->runWithoutInterruption([&] { - return shard->getTargeter() - ->findHostWithMaxWait(readPref, Seconds{20}) - .getNoThrow(ars->_opCtx); - }); + auto findHostStatus = + shard->getTargeter()->findHostWithMaxWait(readPref, Seconds{20}).getNoThrow(ars->_opCtx); if (findHostStatus.isOK()) shardHostAndPort = std::move(findHostStatus.getValue()); diff --git a/src/mongo/transport/baton_asio_linux.h b/src/mongo/transport/baton_asio_linux.h index 979e1461f35..f96e73b67a3 100644 --- a/src/mongo/transport/baton_asio_linux.h +++ b/src/mongo/transport/baton_asio_linux.h @@ -218,7 +218,7 @@ public: } void notify() noexcept override { - schedule([] {}); + _efd.notify(); } /** |