send SIGKILL to unterminated child jobs

If we haven't exited 2 seconds after SIGTERM, send SIGKILL. This
allows aborting of runs with wayward descendent processes.
pull/137/head
Oliver Giles 4 years ago
parent 1bb545e3f9
commit 559a6480ee

@ -83,7 +83,10 @@ Leader::Leader(kj::AsyncIoContext &ioContext, kj::Filesystem &fs, const char *jo
scripts.pop();
// TODO: probably shouldn't do this if we are already in a runOnAbort script
kill(-currentGroupId, SIGTERM);
// TODO: wait a few seconds for exit, then send KILL?
return this->ioContext.provider->getTimer().afterDelay(2*kj::SECONDS).then([this]{
fprintf(stderr, "[laminar] sending SIGKILL to process group %d\n", currentGroupId);
kill(-currentGroupId, SIGKILL);
});
}));
pipe(setEnvPipe);

Loading…
Cancel
Save