8784: Link directly to keep-web when sharing collections.
[arvados.git] / crunch_scripts / run-command
index 266a12d237a9d953889b3f2edcc86db859503540..74793d4fce40ae84a820a72db74b69a6c92f3ec4 100755 (executable)
@@ -399,16 +399,17 @@ try:
     while len(pids) > 0:
         try:
             (pid, status) = os.wait()
-            pids.discard(pid)
-            if not taskp.get("task.ignore_rcode"):
-                rcode[pid] = (status >> 8)
-            else:
-                rcode[pid] = 0
         except OSError as e:
             if e.errno == errno.EINTR:
                 pass
             else:
                 raise
+        else:
+            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)