Skip to content

test(fixture): close the writer fd before chmod and shrink launch stress - #1636

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/1625-fixture-fd-headroom
Nov 3, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/1625-fixture-fd-headroom

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Fixes #1625 (options B + A from the issue's recommended path, landed together).

Changes

  1. Explicit fd lifecycle (Option B): write_executable_fixture replaces fs::write with File::create → write_all → sync_all → explicit drop(file) → set_permissions. The writer descriptor is now closed inside the launch write-lock and before chmod, so a child forked after the write cannot inherit a writable handle on the fixture inode, and the chmod sees a fully persisted file.
  2. Runner headroom (Option A): concurrent_children_cannot_inherit_executable_fixture_writers drops from 8 reader threads × 250 launches to 4 × 50 (barrier 9 → 5). The control still exercises concurrent spawn/write coordination with the 64 KiB script, but stays within headroom observed to be flaky when multiple gate jobs load the runner.

The RwLock write-vs-spawn coordination itself is unchanged.

Validation

  • cargo check --locked --target x86_64-unknown-linux-gnu --all-targets — clean (both changed items are unix/Linux-gated, so local Windows lanes don't compile them).
  • The Linux gate runs the actual control concurrently with the rest of the suite; a single green run is expected signal, not a flake-elimination proof — the fix removes the inheritance window (B) and the load-triggered widening (A), both identified failure modes.
  • Known gap: neither change alters the cross-process gap (Option D territory); the shared fixture paths here are per-tempdir, so cross-binary contention is not in scope for this control.

write_executable_fixture now creates, writes, syncs and explicitly
drops the descriptor inside the launch lock before chmod, so no later
fork can inherit a writable handle on the fixture inode; the shared
control drops from 8x250 to 4x50 launches to stay within loaded-runner
headroom while still exercising concurrent spawn/write coordination.
Addresses the intermittent ETXTBSY-family gate failures tracked in
#1625.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 151 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e5406b1b-33bb-409f-9f03-7de37cc4f3dc
Commits

Reviewing files that changed from the base of the PR and between b8854c5 and 396adc7.

Files selected for processing: 1
  • tests/common/executable_fixture.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

test(common): concurrent_children_cannot_inherit_executable_fixture_writers is flaky under concurrent gate runs

1 participant