-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling if exception occurs during shutdown #4168
Conversation
schd.suite_shutdown = ctrl_c | ||
setattr(schd, 'suite_shutdown', ctrl_c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This plays better with mypy
b7e0b49
to
cf55d5f
Compare
Ignore test failures (due to DNS issue). Recommend running pytest locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tested as working 👍
But don't show more context than needed in traceback
- Remove pointless (and broken) assert - Add some type annotations
cf55d5f
to
78ced9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning is that an error during the running of the workflow can still end with a complete shutdown, but an error during shutdown likely means the shutdown did not complete. Also, there's already a fair bit of error handling in the |
Ah ok, my reasoning would be if you are raising an error in, for example The reason why I became aware of this bug and raised the issue, was at one stage (before a change implemented in
From my tests, this error handling will not help here if you look at the call stack, |
I've made it so that if a |
I have locally run:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MetRonnie!
These changes close #4147
Ensure that if an exception occurs during shutdown, it gets logged before exiting.
This is difficult to test for other than manually; see the steps to reproduce in the issueI've added an integration test, but probably worth manually running the example in #4147 tooRequirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.