##// END OF EJS Templates
worker: propagate exit code to main process...
Yuya Nishihara -
r32042:8f8ad013 default
parent child Browse files
Show More
@@ -144,13 +144,15 b' def _posixworker(ui, func, staticargs, a'
144 144 os.close(rfd)
145 145 for i, item in func(*(staticargs + (pargs,))):
146 146 os.write(wfd, '%d %s\n' % (i, item))
147 return 0
147 148
148 149 # make sure we use os._exit in all code paths. otherwise the worker
149 150 # may do some clean-ups which could cause surprises like deadlock.
150 151 # see sshpeer.cleanup for example.
152 ret = 0
151 153 try:
152 154 try:
153 scmutil.callcatch(ui, workerfunc)
155 ret = scmutil.callcatch(ui, workerfunc)
154 156 finally:
155 157 ui.flush()
156 158 except KeyboardInterrupt:
@@ -162,7 +164,7 b' def _posixworker(ui, func, staticargs, a'
162 164 finally:
163 165 os._exit(255)
164 166 else:
165 os._exit(0)
167 os._exit(ret & 255)
166 168 pids.add(pid)
167 169 os.close(wfd)
168 170 fp = os.fdopen(rfd, pycompat.sysstr('rb'), 0)
@@ -70,8 +70,9 b' Known exception should be caught, but pr'
70 70 > test 100000.0 abort
71 71 start
72 72 abort: known exception
73 done
73 [255]
74 74
75 75 $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \
76 76 > test 100000.0 abort --traceback 2>&1 | grep '^Traceback'
77 77 Traceback (most recent call last):
78 Traceback (most recent call last):
General Comments 0
You need to be logged in to leave comments. Login now