@@ -441,7 +441,7 @@ namespace {
441441 Status ReplicaSetMonitor::initialize () {
442442 boost::lock_guard<boost::mutex> lock (watcherLifetimeLock);
443443 if (replicaSetMonitorWatcher) {
444- return Status (ErrorCodes::IllegalOperation ,
444+ return Status (ErrorCodes::AlreadyInitialized ,
445445 " ReplicaSetMonitorWatcher has already been initialized" );
446446 }
447447 replicaSetMonitorWatcher.reset (new ReplicaSetMonitorWatcher ());
@@ -451,15 +451,15 @@ namespace {
451451 Status ReplicaSetMonitor::shutdown (int gracePeriodMillis) {
452452 boost::lock_guard<boost::mutex> lock (watcherLifetimeLock);
453453 if (!replicaSetMonitorWatcher) {
454- return Status (ErrorCodes::IllegalOperation ,
454+ return Status (ErrorCodes::InternalError ,
455455 " ReplicaSetMonitorWatcher has not been initialized" );
456456 }
457457 // Call cancel first, in case the RSMW was never started.
458458 replicaSetMonitorWatcher->cancel ();
459459 replicaSetMonitorWatcher->stop ();
460460 bool success = replicaSetMonitorWatcher->wait (gracePeriodMillis);
461461 if (!success) {
462- return Status (ErrorCodes::InternalError ,
462+ return Status (ErrorCodes::ExceededTimeLimit ,
463463 " Timed out waiting for ReplicaSetMonitorWatcher to shutdown" );
464464 }
465465 replicaSetMonitorWatcher.reset ();
0 commit comments