Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change subproc sigint handler to exit more cleanly
The very fast exit of os._exit can cause the stdlib multiproc glue code in the parent process, specifically the queues readers that shuttle results between processes, to deadlock. It appears that using `sys.exit` in subprocesses instead allows those queues to close in a way that does not cause the parent process to deadlock, while still ensuring that subprocesses exit. As a refresher: Even if the work function passed to subprocs catches KeyboardInterrupt, the multiprocessing queue code still throws, so a signal handler of some kind is needed to prevent $numproc stacktraces being printed on interrupt. Testing Done: https://travis-ci.org/pantsbuild/pants/builds/56935938 Reviewed at https://rbcommons.com/s/twitter/r/2024/
- Loading branch information