diff options
| author | Ben Caimano <ben.caimano@10gen.com> | 2019-07-24 14:30:04 -0400 |
|---|---|---|
| committer | Ben Caimano <ben.caimano@10gen.com> | 2019-07-29 16:37:15 -0400 |
| commit | cc04956b4da01e57abd70b4adc3f4f673451ee56 (patch) | |
| tree | 6085995591c05ab42a4d739c5da09bc1f863e4e9 /src/mongo/s/server.cpp | |
| parent | 295e292133b40837a57abe72d78cb2127ecef18a (diff) | |
| download | mongo-cc04956b4da01e57abd70b4adc3f4f673451ee56.tar.gz | |
SERVER-35114 Make it possible to adjust the period of active jobs in the PeriodicRunner
(cherry picked from commit bf4a3cff4dc5572f2e97cb5279fe63c8227187e0)
SERVER-39936 Use PeriodicRunner handles to simplify shutdown ordering
(cherry picked from commit 1eff33bd1a8d48eb607675f87faf1836ba325006)
This is a partial backport. Parts of the original commits listed do not
exist in v4.0
Diffstat (limited to 'src/mongo/s/server.cpp')
| -rw-r--r-- | src/mongo/s/server.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index ad5817c67b9..ce517052716 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -191,12 +191,6 @@ void cleanupTask(ServiceContext* serviceContext) { if (serviceContext) { serviceContext->setKillAllOperations(); - - // Shut down the background periodic task runner. - auto runner = serviceContext->getPeriodicRunner(); - if (runner) { - runner->shutdown(); - } } // Perform all shutdown operations after setKillAllOperations is called in order to ensure @@ -432,9 +426,10 @@ ExitCode runMongosServer(ServiceContext* serviceContext) { PeriodicTask::startRunningPeriodicTasks(); // Set up the periodic runner for background job execution - auto runner = makePeriodicRunner(serviceContext); - runner->startup(); - serviceContext->setPeriodicRunner(std::move(runner)); + { + auto runner = makePeriodicRunner(serviceContext); + serviceContext->setPeriodicRunner(std::move(runner)); + } SessionKiller::set(serviceContext, std::make_shared<SessionKiller>(serviceContext, killSessionsRemote)); |
