Do not turn an interruption into a failed Python activity - #274
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InterruptExecutionraised while a Python activity runs, typically by the SIGTERM handler inchaoslib.exit, was wrapped intoActivityFailedby the Python provider's catch-all. The run then carried on as if only that activity had failed, and could end with statuscompleted.InterruptExecutionas is, so it reaches the runner and the journal is markedinterrupted. Rollbacks follow the rollback strategy as for any other interruption.KeyboardInterruptis not anException.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 raisingInterruptExecutioninterrupts the run.