-
Notifications
You must be signed in to change notification settings - Fork 110
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
Make sure to establish connection and empty the event queue before cancelling publisher #7562
Conversation
5094944
to
c364398
Compare
30b798e
to
8da5f60
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7562 +/- ##
==========================================
+ Coverage 85.19% 85.21% +0.01%
==========================================
Files 388 388
Lines 23338 23352 +14
Branches 893 887 -6
==========================================
+ Hits 19883 19899 +16
+ Misses 3348 3341 -7
- Partials 107 112 +5 ☔ View full report in Codecov by Sentry. |
.pre-commit-config.yaml
Outdated
@@ -16,7 +16,7 @@ repos: | |||
- id: ruff-format | |||
|
|||
- repo: https://github.com/pre-commit/mirrors-clang-format | |||
rev: v18.1.1 | |||
rev: v18.1.3 |
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.
would be nice to have in a separate commit in case of rollbacks.
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.
Sorry, left over. Will rm.
src/ert/async_utils.py
Outdated
@@ -40,6 +41,16 @@ def _done_callback(task: asyncio.Task[_T_co]) -> None: | |||
if (exc := task.exception()) is None: | |||
return | |||
|
|||
logger.error(f"Exception occurred during {task.get_name()}", exc_info=exc) | |||
# logger.error(f"Exception occurred during {task.get_name()}", exc_info=exc) |
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.
rm this line
@@ -164,7 +164,6 @@ def sample_prior(nx, ny): | |||
) | |||
|
|||
|
|||
@pytest.mark.skip(reason="Very flaky with scheduler") |
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.
thank you for not forgetting this! 😄
@@ -215,14 +225,18 @@ async def _monitor_and_handle_tasks( | |||
) | |||
logger.error( | |||
( | |||
f"Exception in scheduler task: {task_exception}\n" | |||
f"Exception in scheduler task {task.get_name()}: {task_exception}\n" |
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 should perhaps be a separate commit, as it is unrelated to fixing the premature closing of publisher.
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.
Now it's in two commits. 1) improving exception messages 2) the actual fix
6f85d2d
to
ab1bf8f
Compare
- Add _publisher_done event and CLOSE_PUBLISHER_SENTINEL to make sure that the connection was established and all events were sent before the cancellation happens. - Supress CancelledError when task gets cancelled for long running jobs - Ignore cancellation in job task - Add test for scheduler publishings its events to a websocket with publisher_done set Event. Co-authored-by: Håvard Berland <[email protected]>
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.
splendid
Issue
Resolves #7522
When applicable