Skip to content

fix: use atomic rename in setup_subprocess_double_fork test#2815

Open
bfirsh wants to merge 1 commit intomainfrom
fix/flaky-setup-subprocess-double-fork
Open

fix: use atomic rename in setup_subprocess_double_fork test#2815
bfirsh wants to merge 1 commit intomainfrom
fix/flaky-setup-subprocess-double-fork

Conversation

@bfirsh
Copy link
Member

@bfirsh bfirsh commented Mar 5, 2026

Summary

  • Fixes a race condition in the setup_subprocess_double_fork integration test that causes flaky CI failures
  • The forked child process was writing .outbox directly, allowing the predictor to observe the file (via os.path.exists) before content was fully flushed — resulting in "output":"" instead of the expected value
  • Uses atomic write pattern: write to .outbox.tmp first, then os.rename() to .outbox, so the predictor never reads a partially-written file

…t race condition

The forked child process writes .outbox directly, which means the
predictor can observe the file (via os.path.exists) before the content
is fully flushed. Write to .outbox.tmp first, then os.rename() to
.outbox so the predictor never reads a partially-written file.
@bfirsh bfirsh requested a review from a team as a code owner March 5, 2026 03:53
@michaeldwan michaeldwan added this to the 0.18.0 milestone Mar 5, 2026
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