Increase child cleanup timeout from 5 to 10 seconds, improved shutdown handling
This commit is contained in:
parent
3e6b7fc9e8
commit
42b9ec08af
1 changed files with 14 additions and 15 deletions
|
@ -99,28 +99,27 @@ void Util::Procs::exit_handler() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WARN_MSG("Sending SIGINT to remaining %d children", (int)listcopy.size());
|
INFO_MSG("Sending SIGINT and waiting up to 10 seconds for %d children to terminate.", (int)listcopy.size());
|
||||||
//send sigint to all remaining
|
|
||||||
if (!listcopy.empty()) {
|
|
||||||
for (it = listcopy.begin(); it != listcopy.end(); it++) {
|
|
||||||
DEBUG_MSG(DLVL_DEVEL, "SIGINT %d", *it);
|
|
||||||
kill(*it, SIGINT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
INFO_MSG("Waiting up to 5 seconds for %d children to terminate.", (int)listcopy.size());
|
|
||||||
waiting = 0;
|
waiting = 0;
|
||||||
//wait up to 5 seconds for applications to shut down
|
//wait up to 10 seconds for applications to shut down
|
||||||
while (!listcopy.empty() && waiting <= 250) {
|
while (!listcopy.empty() && waiting <= 500) {
|
||||||
|
bool doWait = true;
|
||||||
for (it = listcopy.begin(); it != listcopy.end(); it++) {
|
for (it = listcopy.begin(); it != listcopy.end(); it++) {
|
||||||
if (!childRunning(*it)) {
|
if (!childRunning(*it)) {
|
||||||
listcopy.erase(it);
|
listcopy.erase(it);
|
||||||
|
doWait = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!listcopy.empty()) {
|
}
|
||||||
Util::wait(20);
|
if (doWait && !listcopy.empty()) {
|
||||||
++waiting;
|
if ((waiting % 50) == 0){
|
||||||
|
for (it = listcopy.begin(); it != listcopy.end(); it++) {
|
||||||
|
INFO_MSG("SIGINT %d", *it);
|
||||||
|
kill(*it, SIGINT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Util::wait(20);
|
||||||
|
++waiting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (listcopy.empty()) {
|
if (listcopy.empty()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue