Skip to content

Do not turn an interruption into a failed Python activity - #274

Merged
Lawouach merged 2 commits into
masterfrom
fix-interrupt-in-python-activity
Sep 27, 2026
Merged

Lawouach merged 2 commits into
masterfrom
fix-interrupt-in-python-activity

Conversation

@Lawouach

Copy link
Copy Markdown
Contributor

Summary

  • An InterruptExecution raised while a Python activity runs, typically by the SIGTERM handler in chaoslib.exit, was wrapped into ActivityFailed by the Python provider's catch-all. The run then carried on as if only that activity had failed, and could end with status completed.
  • The provider now re-raises InterruptExecution as is, so it reaches the runner and the journal is marked interrupted. Rollbacks follow the rollback strategy as for any other interruption.
  • SIGINT was not affected since KeyboardInterrupt is not an Exception.

Tests

  • test_sigterm_during_python_activity_interrupts_the_run: SIGTERM while a Python activity runs interrupts the run, skips the next activity and plays the rollback.
  • test_interruption_raised_by_python_activity_interrupts_the_run: an activity raising InterruptExecution interrupts the run.
  • Both fail without the fix. Full suite: 328 passed.

An InterruptExecution raised while a Python activity runs, on SIGTERM for
instance, was wrapped into ActivityFailed. The run then carried on as if
only that activity had failed and could complete. It now reaches the
runner and the run is interrupted.

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
@Lawouach
Lawouach merged commit 66bf364 into master Sep 27, 2026
9 checks passed
@Lawouach
Lawouach deleted the fix-interrupt-in-python-activity branch September 27, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant