Change subproc sigint handler to exit more cleanly

Review Request #2024 - Created April 3, 2015 and submitted

Information
David Taylor
pants
a8f24a2...
Reviewers
pants-reviews
jsirois, patricklaw

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.

https://travis-ci.org/pantsbuild/pants/builds/56935938

Patrick Lawson
Ity Kaul
David Taylor
Review request changed

Status: Closed (submitted)

Change Summary:

14886c506afde95ccf8c99e86e37b05a337f9898

Loading...