diff options
Diffstat (limited to 'src/mongo/s/commands/internal_transactions_test_command.h')
-rw-r--r-- | src/mongo/s/commands/internal_transactions_test_command.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/s/commands/internal_transactions_test_command.h b/src/mongo/s/commands/internal_transactions_test_command.h index c5bf8b61951..63b88c44d51 100644 --- a/src/mongo/s/commands/internal_transactions_test_command.h +++ b/src/mongo/s/commands/internal_transactions_test_command.h @@ -34,6 +34,8 @@ #include "mongo/db/commands/internal_transactions_test_command_gen.h" #include "mongo/db/query/find_command_gen.h" #include "mongo/db/transaction_api.h" +#include "mongo/executor/network_interface_factory.h" +#include "mongo/executor/thread_pool_task_executor.h" #include "mongo/logv2/log.h" #include "mongo/s/grid.h" #include "mongo/stdx/future.h" @@ -63,8 +65,8 @@ public: auto sharedBlock = std::make_shared<SharedBlock>(Base::request().getCommandInfos()); const auto executor = Grid::get(opCtx)->isShardingInitialized() - ? static_cast<ExecutorPtr>(Grid::get(opCtx)->getExecutorPool()->getFixedExecutor()) - : static_cast<ExecutorPtr>(getTransactionExecutor()); + ? Grid::get(opCtx)->getExecutorPool()->getFixedExecutor() + : getTransactionExecutor(); // If internalTransactionsTestCommand is received by a mongod, it should be instantiated // with the TransactionParticipant's resource yielder. If on a mongos, txn should be @@ -141,10 +143,10 @@ public: ActionType::internal)); } - const std::shared_ptr<ThreadPool>& getTransactionExecutor() { + std::shared_ptr<executor::TaskExecutor> getTransactionExecutor() { static Mutex mutex = MONGO_MAKE_LATCH("InternalTransactionsTestCommandExecutor::_mutex"); - static std::shared_ptr<ThreadPool> executor; + static std::shared_ptr<executor::ThreadPoolTaskExecutor> executor; stdx::lock_guard<Latch> lg(mutex); if (!executor) { @@ -152,7 +154,9 @@ public: options.poolName = "InternalTransaction"; options.minThreads = 0; options.maxThreads = 4; - executor = std::make_shared<ThreadPool>(std::move(options)); + executor = std::make_shared<executor::ThreadPoolTaskExecutor>( + std::make_unique<ThreadPool>(std::move(options)), + executor::makeNetworkInterface("InternalTransactionNetwork")); executor->startup(); } return executor; |