[devUtils/procRunner] wait for proc to exit so we fallback to SIGKILL (#20918) (#20951)

This commit is contained in:
Spencer 2018-07-19 15:36:52 -07:00 committed by GitHub
parent b8494d8594
commit 1bce3b4642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,10 +122,13 @@ export function createProc(name, { cmd, args, cwd, env, stdin, log }) {
await withTimeout(
async () => {
await treeKillAsync(childProcess.pid, signal);
await this.getOutcomePromise();
},
STOP_TIMEOUT,
async () => {
log.warning(`Proc "${name}" was sent "${signal}" and didn't exit after ${STOP_TIMEOUT} ms, sending SIGKILL`);
log.warning(
`Proc "${name}" was sent "${signal}" and didn't emit the "exit" or "error" events after ${STOP_TIMEOUT} ms, sending SIGKILL`
);
await treeKillAsync(childProcess.pid, 'SIGKILL');
}
);