This changes how we run subprocesses to wait for the subprocesses with process.waitUntilExit() rather than relying on NotificationCenter to deliver a process terminated exception. I ran into cases where this notification wasn't being delivered even when the process had exited (I'm not sure why). This does have the downside that if the process ignores SIGTERM we'll hang, but it seems reasonable safe to assume processes we launch will be well behaved and terminate upon getting a SIGTERM. This also attempts to clean up the process running code to be a bit easier to read.
This changes how we run subprocesses to wait for the subprocesses with
process.waitUntilExit()
rather than relying onNotificationCenter
to deliver a process terminated exception. I ran into cases where this notification wasn't being delivered even when the process had exited (I'm not sure why). This does have the downside that if the process ignoresSIGTERM
we'll hang, but it seems reasonable safe to assume processes we launch will be well behaved and terminate upon getting aSIGTERM
. This also attempts to clean up the process running code to be a bit easier to read.