Skip to content

Commit 1ae46ab

Browse files
committed
slighly cleaner shutdown
1 parent b7ac0e7 commit 1ae46ab

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

s/strategy.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace mongo {
9090
OID lastID;
9191
lastID.clear();
9292
int secsToSleep = 0;
93-
while ( Shard::isMember( _addr ) ){
93+
while ( ! inShutdown() && Shard::isMember( _addr ) ){
9494

9595
if ( lastID.isSet() ){
9696
scoped_lock lk( _seenWritebacksLock );
@@ -159,8 +159,14 @@ namespace mongo {
159159
continue;
160160
}
161161
catch ( std::exception e ){
162-
log() << "WriteBackListener exception : " << e.what() << endl;
163162

163+
if ( inShutdown() ){
164+
// we're shutting down, so just clean up
165+
return;
166+
}
167+
168+
log() << "WriteBackListener exception : " << e.what() << endl;
169+
164170
// It's possible this shard was removed
165171
Shard::reloadShardInfo();
166172
}

0 commit comments

Comments
 (0)