-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StateMachine
: transition directly to excepted if transition failed
Before, if a state transition failed a transition to the excepted state would be initiated. However, if the original failure came from a method that would be called in all state transitions, i.e. also when transitioning to the excepted, it would be guaranteed to be hit again. In the second transition failure, the exception would simply be raised again and bubble up. In the case of a transition failure and so `self._transition_failed` is set to `True`, the current state should not be explicitly exited but one should transition straight to the excepted state. This change now effectively allows the state machine to transition from a `FINISHED` state to the `EXCEPTED` state. A process could transition to the `FINISHED` state and on exiting the `FINISHED` state, an exception could be raised. In this case the result of the future would already be set, so the `on_except` method needs to check for this, and when set, first reset the future before setting the exception.
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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