summaryrefslogtreecommitdiff
path: root/db/repl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'db/repl.cpp')
-rw-r--r--db/repl.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/db/repl.cpp b/db/repl.cpp
index a0ac16e..efb078b 100644
--- a/db/repl.cpp
+++ b/db/repl.cpp
@@ -1720,22 +1720,21 @@ namespace mongo {
sleepsecs(4);
Client::initThread("replmaster");
while( 1 ) {
- {
- dblock lk;
- cc().getAuthenticationInfo()->authorize("admin");
- }
sleepsecs(10);
/* write a keep-alive like entry to the log. this will make things like
printReplicationStatus() and printSlaveReplicationStatus() stay up-to-date
even when things are idle.
*/
{
- writelock lk("");
- try {
- logKeepalive();
- }
- catch(...) {
- log() << "caught exception in replMasterThread()" << endl;
+ writelocktry lk("");
+ if ( lk.got() ){
+ cc().getAuthenticationInfo()->authorize("admin");
+ try {
+ logKeepalive();
+ }
+ catch(...) {
+ log() << "caught exception in replMasterThread()" << endl;
+ }
}
}
}