Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/worker.py @ 19406:3185b347ae98
worker: check problem state correctly (issue3982)
If a large update triggered an abort, it was possible for the main
thread to still update the dirstate.
This fix is incomplete, as the failing worker now doesn't generate a
proper error message. This is difficult in the fork-based framework,
which relies on exceptions propagating to the top of the dispatcher
for formatting.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 16 Jul 2013 11:53:53 -0500 |
parents | 05d5821e0dc8 |
children | c7ec39c1a381 |
comparison
equal
deleted
inserted
replaced
19405:447332970d7b | 19406:3185b347ae98 |
---|---|
107 if err.errno != errno.ESRCH: | 107 if err.errno != errno.ESRCH: |
108 raise | 108 raise |
109 def waitforworkers(): | 109 def waitforworkers(): |
110 for _ in pids: | 110 for _ in pids: |
111 st = _exitstatus(os.wait()[1]) | 111 st = _exitstatus(os.wait()[1]) |
112 if st and not problem: | 112 if st and not problem[0]: |
113 problem[0] = st | 113 problem[0] = st |
114 killworkers() | 114 killworkers() |
115 t = threading.Thread(target=waitforworkers) | 115 t = threading.Thread(target=waitforworkers) |
116 t.start() | 116 t.start() |
117 def cleanup(): | 117 def cleanup(): |