X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/508d3b100a3faa9711e42a32ddeaade5da2470da..3cc77494ac02e0f64a814cd4a898662fb7b329af:/crunch_scripts/run-command diff --git a/crunch_scripts/run-command b/crunch_scripts/run-command index a6c5ef981c..74793d4fce 100755 --- a/crunch_scripts/run-command +++ b/crunch_scripts/run-command @@ -397,12 +397,19 @@ try: active = 1 pids = set([s.pid for s in subprocesses]) while len(pids) > 0: - (pid, status) = os.wait() - pids.discard(pid) - if not taskp.get("task.ignore_rcode"): - rcode[pid] = (status >> 8) + try: + (pid, status) = os.wait() + except OSError as e: + if e.errno == errno.EINTR: + pass + else: + raise else: - rcode[pid] = 0 + pids.discard(pid) + if not taskp.get("task.ignore_rcode"): + rcode[pid] = (status >> 8) + else: + rcode[pid] = 0 if sig.sig is not None: logger.critical("terminating on signal %s" % sig.sig)