Skip to content

Commit eb63281

Browse files
committed
tackled some more rare race conditions
1 parent 1fd2f80 commit eb63281

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bqskit/runtime/worker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,13 @@ def _try_step_next_ready_task(self) -> None:
463463
except StopIteration as e:
464464
self._process_task_completion(task, e.value)
465465

466-
except Exception:
466+
except Exception as e:
467+
if type(e) is RuntimeError:
468+
# In rare cases, a cancelled task will cause a RuntimeError in step or _process_await
469+
for addr in self._cancelled_task_ids:
470+
if task.is_descendant_of(addr):
471+
return
472+
467473
assert self._active_task is not None # for type checker
468474

469475
# Bubble up errors

0 commit comments

Comments
 (0)