Skip to content

[Backport version-19.0] Avoid race condition for multiple everest monitors#12817

Merged
berland merged 1 commit intoversion-19.0from
backport-12814-to-version-19.0
Feb 6, 2026
Merged

[Backport version-19.0] Avoid race condition for multiple everest monitors#12817
berland merged 1 commit intoversion-19.0from
backport-12814-to-version-19.0

Conversation

@scout-team-app
Copy link

@scout-team-app scout-team-app bot commented Feb 6, 2026

Description

Backport of #12814 to version-19.0.

If several monitors (each is a subscriber) are attached to an everest
server, the server could crash with a RuntimeError when tearing down;

Traceback (most recent call last):
  File "/data/projects/ert/src/ert/dark_storage/endpoints/experiment_server.py", line 341, in run
    for sub in shared_data.subscribers.values():
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: dictionary changed size during iteration

This is because there is an await in the loop execution body, which
allows the async loop to add a new subscriber while we are iterating.

By expanding the values() iterator to a fixed list before looping, we
avoid the possibility of a race condition (but we are leaving behind the
possible late added subscriber)

Repeated testing with multiple monitors with this patch has not
revealed any further issues.

(cherry picked from commit 2870c3c)
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.54%. Comparing base (fcb9a5f) to head (5ef1319).
⚠️ Report is 1 commits behind head on version-19.0.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rc/ert/dark_storage/endpoints/experiment_server.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           version-19.0   #12817   +/-   ##
=============================================
  Coverage         90.54%   90.54%           
=============================================
  Files               437      437           
  Lines             30098    30098           
=============================================
  Hits              27251    27251           
  Misses             2847     2847           
Flag Coverage Δ
cli-tests 37.15% <0.00%> (ø)
gui-tests 68.63% <0.00%> (+<0.01%) ⬆️
performance-and-unit-tests 76.82% <0.00%> (ø)
test 37.95% <0.00%> (ø)

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.

@berland berland enabled auto-merge (rebase) February 6, 2026 13:07
@berland berland merged commit 5970b5e into version-19.0 Feb 6, 2026
37 checks passed
@berland berland deleted the backport-12814-to-version-19.0 branch February 6, 2026 13:08
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2026

Merging this PR will not alter performance

✅ 23 untouched benchmarks


Comparing backport-12814-to-version-19.0 (5ef1319) with version-19.0 (fcb9a5f)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants