Skip to content

Commit fba4728

Browse files
committed
fix
1 parent f21f717 commit fba4728

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

cwltool/main.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,12 @@ def runner():
299299
threads.add(thread)
300300
thread.start()
301301

302-
302+
def wait_for_next_completion():
303+
fetch_iter_lock.acquire()
304+
fetch_iter_lock.acquire()
305+
fetch_iter_lock.release()
306+
if exception is not None:
307+
raise exception
303308

304309
jobiter = t.job(job_order_object, output_callback, **kwargs)
305310

@@ -312,17 +317,15 @@ def runner():
312317
output_dirs.add(r.outdir)
313318
run_job(r)
314319
else:
315-
if exception is not None:
316-
raise exception
317320
if len(threads):
318-
# wait until one job completes to try fetching jobiter again
319-
fetch_iter_lock.acquire()
320-
fetch_iter_lock.acquire()
321-
fetch_iter_lock.release()
321+
wait_for_next_completion()
322322
else:
323323
_logger.error("Workflow cannot make any more progress.")
324324
break
325325

326+
while len(threads) > 0:
327+
wait_for_next_completion()
328+
326329
if final_output and final_output[0] and finaloutdir:
327330
final_output[0] = relocateOutputs(final_output[0], finaloutdir,
328331
output_dirs, kwargs.get("move_outputs"),

0 commit comments

Comments
 (0)