Skip to content
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

Fix ForwardModelStep handle_process_timeout... timeout #9446

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

jonathan-eq
Copy link
Contributor

@jonathan-eq jonathan-eq commented Dec 4, 2024

This fixes the bug where some code was unreachable after the refactoring in commit 4dc894c

Approach
🔧

(Screenshot of new behavior in GUI if applicable)

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@jonathan-eq jonathan-eq added the release-notes:bug-fix Automatically categorise as bug fix in release notes label Dec 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.85%. Comparing base (0ba0626) to head (2f265bd).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9446      +/-   ##
==========================================
- Coverage   91.86%   91.85%   -0.02%     
==========================================
  Files         433      434       +1     
  Lines       26657    26724      +67     
==========================================
+ Hits        24488    24546      +58     
- Misses       2169     2178       +9     
Flag Coverage Δ
cli-tests 39.34% <0.00%> (-0.09%) ⬇️
everest-models-test 34.75% <100.00%> (-0.08%) ⬇️
gui-tests 72.15% <100.00%> (-0.19%) ⬇️
integration-test 37.00% <100.00%> (-0.16%) ⬇️
performance-tests 51.93% <100.00%> (-0.16%) ⬇️
test 40.67% <100.00%> (+0.15%) ⬆️
unit-tests 74.04% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathan-eq jonathan-eq self-assigned this Dec 4, 2024
@@ -217,7 +217,9 @@ def _run(self) -> Generator[Start | Exited | Running | None]:
exit_code = process.wait(timeout=self.MEMORY_POLL_PERIOD)
except TimeoutExpired:
potential_exited_msg = (
self.handle_process_timeout_and_create_exited_msg(exit_code, proc)
self.handle_process_timeout_and_create_exited_msg(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need some explanation what this function actually does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It handles how we should react on a timeout while polling the process status. If it returns Exited, we yield it and return, otherwise we try again.
It should fail if the running_time goes above what is configured for the forward_model, but we currently reset the running time every time we timeout, so it never reaches this code path.
The timeout function should kill the entire process group if it is different than its own process group, then return an exited message with an error attached.

This fixes the bug where some code was unreachable after the refactoring in commit #4dc894ca63687476e091f582df5a42045190f7bd
Copy link
Contributor

@xjules xjules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good! 🚀

@jonathan-eq jonathan-eq merged commit bf2d515 into equinor:main Dec 10, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:bug-fix Automatically categorise as bug fix in release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants