killDb() needs to have a longer timeout (it currently only waits 6 seconds before dropping the hammer)
The killDb() function waits 1 minute before sending a SIGKILL to the process. Each iteration of the loop below waits for 100 milliseconds and on the 600th iteration, a SIGKILL is sent.
for (int i = 0; i < 1300; ++i) {
|
if (i == 600) {
|
log() << "process on port " << port << ", with pid " << pid
|
<< " not terminated, sending sigkill";
|
kill_wrapper(pid, SIGKILL, port, opt);
|
killSignalSent = true;
|
}
|
processTerminated = wait_for_pid(pid, false, &exitCode);
|
if (processTerminated) {
|
break;
|
}
|
sleepmillis(100);
|
}
|
On the 3.0 branch each iteration of the loop sleeps for 1 second (instead of 100 milliseconds) and the SIGKILL is sent after the 60th (of the 130) iterations.
int i = 0;
|
for (; i < 130; ++i) {
|
if (i == 60) {
|
log() << "process on port " << port << ", with pid " << pid
|
<< " not terminated, sending sigkill" << endl;
|
kill_wrapper(pid, SIGKILL, port, opt);
|
}
|
if (wait_for_pid(pid, false, &exitCode))
|
break;
|
sleepmillis(1000);
|
}
|
|