-
Notifications
You must be signed in to change notification settings - Fork 108
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 in runner.py job.run(...)
#8761
Improve error handling in runner.py job.run(...)
#8761
Conversation
bfc53cf
to
6587920
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8761 +/- ##
==========================================
+ Coverage 91.44% 91.53% +0.09%
==========================================
Files 344 345 +1
Lines 21122 21252 +130
==========================================
+ Hits 19314 19454 +140
+ Misses 1808 1798 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
07228b8
to
8a9720c
Compare
58f3fc2
to
f2f17d7
Compare
|
||
# exit_code is 0 | ||
|
||
if self.job_data.get("error_file") and os.path.exists( | ||
self.job_data["error_file"] | ||
): | ||
yield exited_message.with_error( | ||
exited_message = Exited(self, exit_code) | ||
return exited_message.with_error( |
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.
return?? previously we yielded ....
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.
Yes, but this is a helper function for creating the message that is being yielded from the calling method.
Lots of errors. Wondering if it is related that you have changed some |
f2f17d7
to
baa4c51
Compare
baa4c51
to
b688ca8
Compare
It should be fine. The methods returning values are just for creating the messages that are being yielded in the |
e401754
to
a641fdf
Compare
This commit wraps the `job.run(...)` method in a try-except block making sure the `Exited` message is sent if the job_runner crashes. This fixes the bug where ert is hanging when unhandled exceptions are raised in the job runner.
a641fdf
to
72e838e
Compare
72e838e
to
71daee6
Compare
Issue
Resolves #8738
Approach
This commit wraps the
job.run(...)
method in a try-except block making sure theExited
message is sent if the job_runner crashes. This fixes the bug where ert is hanging when unhandled exceptions are raised in the job runner.The PR also contains a commit that refactors the mega-method
job.run(...)
into separate methods, making it more readable.(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'pytest tests/unit_tests -n logical -m "not integration_test"'
)When applicable