Check safety during transition#518
Merged
jamessynge merged 3 commits intopanoptes:developfrom Jul 11, 2018
Merged
Conversation
If the state doesn't successfully change, check the safety between each iteration and if False send to parking Note: no test for this written
Codecov Report
@@ Coverage Diff @@
## develop #518 +/- ##
===========================================
- Coverage 70.46% 70.33% -0.14%
===========================================
Files 62 62
Lines 5418 5423 +5
Branches 752 753 +1
===========================================
- Hits 3818 3814 -4
- Misses 1392 1401 +9
Partials 208 208
Continue to review full report at Codecov.
|
jamessynge
requested changes
May 26, 2018
| # If we didn't successfully transition, sleep a while then try again | ||
| if not state_changed: | ||
| if _loop_iteration > 5: | ||
| if self.is_safe() is False: |
Contributor
There was a problem hiding this comment.
Let's add logging to indicate what is going on. For example:
if not state_changed:
self.logger.warning("Failed to transition from {} to {}", self.state, self.next_state)
if not self.is_safe():
self.logger.warning("Conditions have become unsafe; setting next state to 'parking'")
self.next_state = 'parking'
elif _loop_iteration > 5:
self.logger.warning("Stuck in current state for 5 iterations, parking")
self.next_state = 'parking'
else:
_loop_iteration = _loop_iteration + 1
self.logger.warning("Sleeping for a bit, then trying the transition again (loop: {})",
_loop_iteration)
self.sleep(with_status=False)
…eather-while-transition-504
jamessynge
approved these changes
Jul 11, 2018
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.
If the state doesn't successfully change, check the safety between each iteration and if False send to parking
Note: still trying to figure out how to test this
Fixes #504