summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-03 11:32:47 -0400
committerAaron <aaron@10gen.com>2009-04-03 11:32:47 -0400
commit83a1aded10fcbe7c42228e1fd1ebe27866b8c0aa (patch)
tree4e6d238c621980872fc2487cff94b66cd73b66cb
parent0dd264adb5a5bba6dbc2a8145aa0918bee756a12 (diff)
downloadmongo-83a1aded10fcbe7c42228e1fd1ebe27866b8c0aa.tar.gz
validate kill call, wait longer for process to die
-rw-r--r--shell/ShellUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/ShellUtils.cpp b/shell/ShellUtils.cpp
index 1b7cfc18ad9..5358cffd515 100644
--- a/shell/ShellUtils.cpp
+++ b/shell/ShellUtils.cpp
@@ -473,13 +473,13 @@ void killDb( int port, int signal ) {
}
pid_t pid = dbs[ port ].first;
- kill( pid, signal );
+ assert( 0 == kill( pid, signal ) );
int i = 0;
- for( ; i < 10; ++i ) {
+ for( ; i < 20; ++i ) {
if ( i == 5 ) {
cout << "process on port " << port << "not terminated, sending sigkill" << endl;
- kill( pid, SIGKILL );
+ assert( 0 == kill( pid, SIGKILL ) );
}
int temp;
int ret = waitpid( pid, &temp, WNOHANG );
@@ -489,7 +489,7 @@ void killDb( int port, int signal ) {
cout << "waiting for process on port " << port << " to terminate" << endl;
sleepms( 1000 );
}
- if ( i == 10 )
+ if ( i == 20 )
assert( "Failed to terminate process" == 0 );
close( dbs[ port ].second );