diff options
Diffstat (limited to 'shell/ShellUtils.cpp')
-rw-r--r-- | shell/ShellUtils.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/shell/ShellUtils.cpp b/shell/ShellUtils.cpp index f71550d1ee6..0213aa3a4d4 100644 --- a/shell/ShellUtils.cpp +++ b/shell/ShellUtils.cpp @@ -475,21 +475,23 @@ void killDb( int port, int signal ) { kill( pid, signal ); int i = 0; - for( ; i < 5; ++i ) { + for( ; i < 10; ++i ) { + if ( i == 5 ) { + cout << "process on port " << port << "not terminated, sending sigkill" << endl; + kill( pid, SIGKILL ); + } int temp; if( waitpid( pid, &temp, WNOHANG ) == pid ) break; cout << "waiting for process on port " << port << " to terminate" << endl; sleepms( 1000 ); } - if ( i == 5 ) { - cout << "process on port " << port << "not terminated, sending sigkill" << endl; - kill( pid, SIGKILL ); - } + if ( i == 10 ) + assert( "Failed to terminate process" == 0 ); close( dbs[ port ].second ); dbs.erase( port ); - if ( signal == SIGKILL || i == 5 ) { + if ( i > 4 || signal == SIGKILL ) { cout << "sleeping after sigkill" << endl; sleepms( 4000 ); // allow operating system to reclaim resources } |