diff options
author | Eric Milkie <milkie@10gen.com> | 2014-12-30 16:23:14 -0500 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2014-12-30 16:23:26 -0500 |
commit | 7dc989123bc46ed26562b86699210aee17fc2009 (patch) | |
tree | 650b7a2e4c40024a1ff73c7f38ef21647cf72169 /src/mongo/db | |
parent | 0777616ff7ce85292e865c0340d92aadf7ba9867 (diff) | |
download | mongo-7dc989123bc46ed26562b86699210aee17fc2009.tar.gz |
SERVER-16694 check for shutdown definitively in bgsync
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/auth/user_cache_invalidator_job.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/catalog/cursor_manager.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/client.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/clientcursor.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/instance.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/range_deleter.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/repl/rs_initialsync.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_source_feedback.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/stats/snapshots.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/data_file.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/data_file_sync.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/dur.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/dur_journal.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/dur_recover.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/ttl.cpp | 1 |
16 files changed, 21 insertions, 2 deletions
diff --git a/src/mongo/db/auth/user_cache_invalidator_job.cpp b/src/mongo/db/auth/user_cache_invalidator_job.cpp index dd5f8c322ec..37bf42f2c22 100644 --- a/src/mongo/db/auth/user_cache_invalidator_job.cpp +++ b/src/mongo/db/auth/user_cache_invalidator_job.cpp @@ -42,6 +42,7 @@ #include "mongo/db/server_parameters.h" #include "mongo/s/config.h" #include "mongo/util/background.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/catalog/cursor_manager.cpp b/src/mongo/db/catalog/cursor_manager.cpp index ea2f7821ab3..8597f410dd6 100644 --- a/src/mongo/db/catalog/cursor_manager.cpp +++ b/src/mongo/db/catalog/cursor_manager.cpp @@ -42,6 +42,7 @@ #include "mongo/db/operation_context.h" #include "mongo/db/query/plan_executor.h" #include "mongo/platform/random.h" +#include "mongo/util/exit.h" #include "mongo/util/startup_test.h" namespace mongo { diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index 2526633dc53..2ccec5fdd9f 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -65,6 +65,7 @@ #include "mongo/s/d_state.h" #include "mongo/scripting/engine.h" #include "mongo/util/concurrency/thread_name.h" +#include "mongo/util/exit.h" #include "mongo/util/file_allocator.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/log.h" diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp index 878d765c6e5..356e25182bb 100644 --- a/src/mongo/db/clientcursor.cpp +++ b/src/mongo/db/clientcursor.cpp @@ -48,6 +48,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/operation_context_impl.h" #include "mongo/db/repl/repl_coordinator_global.h" +#include "mongo/util/exit.h" namespace mongo { diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index 048b0f81bd2..5c1499fff4e 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -1067,6 +1067,10 @@ namespace { return shutdownInProgress.loadRelaxed() != 0; } + bool inShutdownStrict() { + return shutdownInProgress.load() != 0; + } + static void shutdownServer() { log(LogComponent::kNetwork) << "shutdown: going to close listening sockets..." << endl; ListeningSockets::get()->closeAll(); diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp index 851a34d9be3..9cf3abd5f52 100644 --- a/src/mongo/db/range_deleter.cpp +++ b/src/mongo/db/range_deleter.cpp @@ -39,6 +39,7 @@ #include "mongo/db/repl/repl_coordinator_global.h" #include "mongo/db/write_concern_options.h" #include "mongo/util/concurrency/synchronization.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 1d187b9d36e..4ca424574fc 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -45,6 +45,7 @@ #include "mongo/db/repl/rs_rollback.h" #include "mongo/db/repl/rs_sync.h" #include "mongo/db/stats/timer_stats.h" +#include "mongo/util/exit.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" @@ -206,10 +207,10 @@ namespace { } // Wait until we've applied the ops we have before we choose a sync target - while (!_appliedBuffer && !inShutdown()) { + while (!_appliedBuffer && !inShutdownStrict()) { _condvar.wait(lock); } - if (inShutdown()) { + if (inShutdownStrict()) { return; } } diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp index b35ea5f45ea..7091b2b1a70 100644 --- a/src/mongo/db/repl/rs_initialsync.cpp +++ b/src/mongo/db/repl/rs_initialsync.cpp @@ -47,6 +47,7 @@ #include "mongo/db/repl/oplog.h" #include "mongo/db/repl/oplogreader.h" #include "mongo/db/repl/repl_coordinator_global.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" diff --git a/src/mongo/db/repl/sync_source_feedback.cpp b/src/mongo/db/repl/sync_source_feedback.cpp index 459e5d91962..a7bdacc0c6b 100644 --- a/src/mongo/db/repl/sync_source_feedback.cpp +++ b/src/mongo/db/repl/sync_source_feedback.cpp @@ -44,6 +44,7 @@ #include "mongo/db/repl/bgsync.h" #include "mongo/db/repl/repl_coordinator_global.h" #include "mongo/db/operation_context.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" diff --git a/src/mongo/db/stats/snapshots.cpp b/src/mongo/db/stats/snapshots.cpp index d1d8b9ff17e..7809e63ab2c 100644 --- a/src/mongo/db/stats/snapshots.cpp +++ b/src/mongo/db/stats/snapshots.cpp @@ -36,6 +36,7 @@ #include "mongo/db/client.h" #include "mongo/db/clientcursor.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" /** diff --git a/src/mongo/db/storage/mmap_v1/data_file.cpp b/src/mongo/db/storage/mmap_v1/data_file.cpp index 971af81eb92..69ca3e3a041 100644 --- a/src/mongo/db/storage/mmap_v1/data_file.cpp +++ b/src/mongo/db/storage/mmap_v1/data_file.cpp @@ -39,6 +39,7 @@ #include "mongo/db/storage/mmap_v1/dur.h" #include "mongo/db/storage/mmap_v1/mmap_v1_options.h" #include "mongo/db/operation_context.h" +#include "mongo/util/exit.h" #include "mongo/util/file_allocator.h" #include "mongo/util/log.h" diff --git a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp index f21b79cf1e4..635c4e77580 100644 --- a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp +++ b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp @@ -37,6 +37,7 @@ #include "mongo/db/instance.h" #include "mongo/db/storage/mmap_v1/mmap_v1_options.h" #include "mongo/db/storage_options.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/mmap.h" diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp index 14ef3db0524..02990c0fffe 100644 --- a/src/mongo/db/storage/mmap_v1/dur.cpp +++ b/src/mongo/db/storage/mmap_v1/dur.cpp @@ -92,6 +92,7 @@ #include "mongo/db/storage/mmap_v1/mmap_v1_options.h" #include "mongo/db/storage_options.h" #include "mongo/server.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/stacktrace.h" diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp index 132b44ec87a..89f16b62235 100644 --- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp @@ -50,6 +50,7 @@ #include "mongo/util/alignedbuilder.h" #include "mongo/util/checksum.h" #include "mongo/util/compress.h" +#include "mongo/util/exit.h" #include "mongo/util/file.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp index 7631f11155a..d5c79a9eb1c 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp @@ -57,6 +57,7 @@ #include "mongo/util/bufreader.h" #include "mongo/util/checksum.h" #include "mongo/util/compress.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/startup_test.h" diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 9e266937dfb..b3d9b902c59 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -51,6 +51,7 @@ #include "mongo/db/repl/repl_coordinator_global.h" #include "mongo/db/server_parameters.h" #include "mongo/util/background.h" +#include "mongo/util/exit.h" #include "mongo/util/log.h" namespace mongo { |