Skip to content

Commit

Permalink
[BUG] Emit task cancellation events if TaskGraph is cancelled.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Apr 6, 2024
1 parent 782419e commit cf8f9c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,16 @@ def __handle_task_placement(self, event: Event, workload: Workload) -> None:
task,
)
del self._future_placement_events[task.id]
if task.state != TaskState.CANCELLED:
# If the TaskGraph was cancelled, but the Task was not, then we
# emit a specific cancellation event so that the status is
# correctly available to the schedulers.
task_cancellation_event = Event(
event_type=EventType.TASK_CANCEL,
time=event.time,
task=task,
)
self._event_queue.add_event(task_cancellation_event)
return
else:
# If the Task is not ready to run and wasn't cancelled,
Expand Down

0 comments on commit cf8f9c6

Please sign in to comment.