Skip to content

Fixed race condition for trajectory reading#319

Merged
PeterMeisrimelModelon merged 2 commits into
masterfrom
dev-pm-7147
Jun 4, 2025
Merged

Fixed race condition for trajectory reading#319
PeterMeisrimelModelon merged 2 commits into
masterfrom
dev-pm-7147

Conversation

@PeterMeisrimelModelon

@PeterMeisrimelModelon PeterMeisrimelModelon commented May 28, 2025

Copy link
Copy Markdown
Collaborator

This PR is fixing the issue in 2 different ways; thinking we should have both anyways for extra robustness.

Not sure how to write a good unit test for this, the way to reproduce the issue was:

  1. Start a simulation of a sufficiently large & slow model.
  2. In parallel (separate console) run a while loop reading a given (non-diagnostics) trajectory from the growing result file (with allow_file_updates = True).
  3. Even then, it may take a while to actually hit the right state for the race-condition to become a problem.

@PeterMeisrimelModelon PeterMeisrimelModelon self-assigned this May 28, 2025
Comment thread src/common/io.py
@PeterMeisrimelModelon PeterMeisrimelModelon merged commit 2df1e19 into master Jun 4, 2025
2 checks passed
@PeterMeisrimelModelon PeterMeisrimelModelon deleted the dev-pm-7147 branch June 4, 2025 09:50
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