void replSlaveThread() { sleepsecs(1); Client::initThread("replslave"); cc().iAmSyncThread(); { dblock lk; cc().getAuthenticationInfo()->authorize("admin"); BSONObj obj; } while ( 1 ) { try { replMain(); if ( debug_stop_repl ) break; sleepsecs(5); } catch ( AssertionException& ) { ReplInfo r("Assertion in replSlaveThread(): sleeping 5 minutes before retry"); problem() << "Assertion in replSlaveThread(): sleeping 5 minutes before retry" << endl; sleepsecs(300); } } }
void replSlaveThread() { sleepsecs(1); Client::initThread("replslave"); { Lock::GlobalWrite lk; replLocalAuth(); } while ( 1 ) { try { replMain(); sleepsecs(5); } catch ( AssertionException& ) { ReplInfo r("Assertion in replSlaveThread(): sleeping 5 minutes before retry"); problem() << "Assertion in replSlaveThread(): sleeping 5 minutes before retry" << endl; sleepsecs(300); } catch ( DBException& e ) { problem() << "exception in replSlaveThread(): " << e.what() << ", sleeping 5 minutes before retry" << endl; sleepsecs(300); } catch ( ... ) { problem() << "error in replSlaveThread(): sleeping 5 minutes before retry" << endl; sleepsecs(300); } } }