# HG changeset patch # User Yuya Nishihara # Date 2018-12-11 13:34:07 # Node ID 03f7d0822ec1f17c8374f04c4368885bc49da706 # Parent bb5d74a35477751552bf2b95160b57b72940652f worker: do not swallow exception occurred in main process Before, SystemExit(255) would be most likely raised since the worker processes were terminated by the main process and the status would be set to 255 in response. We should instead re-raise the exception occurred first. It's pretty hard to debug problems like the issue 6035 with no traceback. diff --git a/mercurial/worker.py b/mercurial/worker.py --- a/mercurial/worker.py +++ b/mercurial/worker.py @@ -213,11 +213,7 @@ def _posixworker(ui, func, staticargs, a waitforworkers() signal.signal(signal.SIGCHLD, oldchldhandler) selector.close() - status = problem[0] - if status: - if status < 0: - os.kill(os.getpid(), -status) - sys.exit(status) + return problem[0] try: openpipes = len(pipes) while openpipes > 0: @@ -236,7 +232,11 @@ def _posixworker(ui, func, staticargs, a killworkers() cleanup() raise - cleanup() + status = cleanup() + if status: + if status < 0: + os.kill(os.getpid(), -status) + sys.exit(status) def _posixexitstatus(code): '''convert a posix exit status into the same form returned by