diff options
author | Benety Goh <benety@mongodb.com> | 2016-07-07 20:00:42 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-07-12 10:15:50 -0400 |
commit | dd937158a397478de66b079f3c27be13b2165785 (patch) | |
tree | d128a611277a67cab6d569aaaa1ef1fb38b4393a /src/mongo/db/repl/data_replicator_test.cpp | |
parent | fff83703bccb7f2549dd37ea3329e2f608e860dc (diff) | |
download | mongo-dd937158a397478de66b079f3c27be13b2165785.tar.gz |
SERVER-24945 DataReplicator uses single task executor
Diffstat (limited to 'src/mongo/db/repl/data_replicator_test.cpp')
-rw-r--r-- | src/mongo/db/repl/data_replicator_test.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
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<executor::ThreadPoolTaskExecutor>( - stdx::make_unique<ThreadPool>(threadPoolOptions), - executor::makeNetworkInterface("DataReplicatorTest-ASIO")); - _applierTaskExecutor->startup(); auto dataReplicatorExternalState = stdx::make_unique<DataReplicatorExternalStateMock>(); - 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> _syncSourceSelector; - std::unique_ptr<executor::TaskExecutor> _applierTaskExecutor; StorageInterfaceMock* _storageInterface; std::map<NamespaceString, CollectionMockStats> _collectionStats; std::map<NamespaceString, CollectionCloneInfo> _collections; |