Skip to content

Commit

Permalink
SQ: Bulkheads: Protect Task.try_get_next_task_unit() and all overridi…
Browse files Browse the repository at this point in the history
…ng implementations
  • Loading branch information
davidfstr committed Feb 3, 2024
1 parent dbfd83d commit 57c0fba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crystal/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ def clear_completed_children(self) -> None:

# === Public Operations ===

@capture_crashes_to(self)
@fg_affinity
def try_get_next_task_unit(self) -> Optional[Callable[[], None]]:
"""
Expand Down Expand Up @@ -1318,6 +1319,7 @@ def __init__(self, group: ResourceGroup) -> None:
self._children_loaded = False

@overrides
@capture_crashes_to(self)
def try_get_next_task_unit(self) -> Optional[Callable[[], None]]:
if not self._children_loaded:
@capture_crashes_to(self)
Expand Down Expand Up @@ -1570,6 +1572,8 @@ def fg_task() -> None:
# NOTE: Must synchronize access to RootTask.children with foreground thread
fg_call_and_wait(fg_task)

@overrides
@capture_crashes_to(self)
@fg_affinity
def try_get_next_task_unit(self):
if self.complete:
Expand Down

0 comments on commit 57c0fba

Please sign in to comment.