From dd937158a397478de66b079f3c27be13b2165785 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Thu, 7 Jul 2016 20:00:42 -0400 Subject: SERVER-24945 DataReplicator uses single task executor --- src/mongo/db/repl/data_replicator_test.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/mongo/db/repl/data_replicator_test.cpp') diff --git a/src/mongo/db/repl/data_replicator_test.cpp b/src/mongo/db/repl/data_replicator_test.cpp index 394e81f12dd..bdf1152a9c1 100644 --- a/src/mongo/db/repl/data_replicator_test.cpp +++ b/src/mongo/db/repl/data_replicator_test.cpp @@ -47,13 +47,10 @@ #include "mongo/db/repl/sync_source_resolver.h" #include "mongo/db/repl/sync_source_selector.h" #include "mongo/db/repl/update_position_args.h" -#include "mongo/executor/network_interface_factory.h" #include "mongo/executor/network_interface_mock.h" -#include "mongo/executor/thread_pool_task_executor.h" #include "mongo/executor/thread_pool_task_executor_test_fixture.h" #include "mongo/stdx/mutex.h" #include "mongo/util/concurrency/thread_name.h" -#include "mongo/util/concurrency/thread_pool.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" @@ -298,15 +295,9 @@ protected: threadPoolOptions.onCreateThread = [](const std::string& threadName) { Client::initThread(threadName.c_str()); }; - // This task executor is used by the MultiApplier only and should not be used to schedule - // remote commands. - _applierTaskExecutor = stdx::make_unique( - stdx::make_unique(threadPoolOptions), - executor::makeNetworkInterface("DataReplicatorTest-ASIO")); - _applierTaskExecutor->startup(); auto dataReplicatorExternalState = stdx::make_unique(); - dataReplicatorExternalState->taskExecutor = _applierTaskExecutor.get(); + dataReplicatorExternalState->taskExecutor = &getExecutor(); dataReplicatorExternalState->currentTerm = 1LL; dataReplicatorExternalState->lastCommittedOpTime = _myLastOpTime; { @@ -338,10 +329,8 @@ protected: } void tearDown() override { - _applierTaskExecutor->shutdown(); executor::ThreadPoolExecutorTest::shutdownExecutorThread(); executor::ThreadPoolExecutorTest::joinExecutorThread(); - _applierTaskExecutor->join(); _dr.reset(); // tearDown() destroys the task executor which was referenced by the data replicator. @@ -371,7 +360,6 @@ protected: OpTime _myLastOpTime; MemberState _memberState; std::unique_ptr _syncSourceSelector; - std::unique_ptr _applierTaskExecutor; StorageInterfaceMock* _storageInterface; std::map _collectionStats; std::map _collections; -- cgit v1.2.1