2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-24 02:40:26 +01:00

Troubleshoot pre-forked processes

This commit is contained in:
Waf Project 2024-10-28 07:42:50 +08:00
parent 4d97d3a264
commit 634e4f4b3e
2 changed files with 7 additions and 4 deletions

View File

@ -920,12 +920,15 @@ def run_prefork_process(cmd, kwargs, cargs):
if not proc:
return run_regular_process(cmd, kwargs, cargs)
proc.stdin.write(obj)
proc.stdin.write('\n'.encode())
try:
proc.stdin.write(obj)
proc.stdin.write('\n'.encode())
except OSError:
raise OSError('Preforked sub-process:%r is not receiving, status: %r' % (proc.pid, proc.returncode))
proc.stdin.flush()
obj = proc.stdout.readline()
if not obj:
raise OSError('Preforked sub-process %r died' % proc.pid)
raise OSError('Preforked sub-process:%r is not responding, status: %r' % (proc.pid, proc.returncode))
process_pool.append(proc)
lst = cPickle.loads(base64.b64decode(obj))

View File

@ -23,7 +23,7 @@ def run():
txt = sys.stdin.readline().strip()
if not txt:
# parent process probably ended
sys.exit(1)
sys.exit(12)
[cmd, kwargs, cargs] = cPickle.loads(base64.b64decode(txt))
cargs = cargs or {}