Skip to content

experiment: async_std::fs::File cpu.pct reliability 100x#82

Draft
rochdev wants to merge 18 commits into
mainfrom
rochdev/test-async-fs-file
Draft

experiment: async_std::fs::File cpu.pct reliability 100x#82
rochdev wants to merge 18 commits into
mainfrom
rochdev/test-async-fs-file

Conversation

@rochdev

@rochdev rochdev commented Jun 4, 2026

Copy link
Copy Markdown
Member

Experiment to measure reliability of async_std::fs::File in read_one_byte on CI.

Runs ready_signal_cpu_pct_bounded 100 times and reports pass/failure count.
If cpu.pct.wall.time exceeds 100% on any run, that counts as a failure.

See companion PR for spawn_blocking comparison.

🤖 Generated with Claude Code

rochdev and others added 14 commits June 3, 2026 15:46
RUSAGE_CHILDREN only updates after a child exits and is waited for,
so the rusage snapshot taken at signal time is identical to the
original baseline. Only wall.time and instructions (Linux) are
post-ready; document this accurately in README and spec.
The pipe already signals child exit via EOF when the write end closes,
so racing the pipe against child.status() is unnecessary. Sequential
await is simpler and removes the futures dependency entirely.
…ed CI flakiness on macOS)

async_std::fs::File on macOS uses kqueue-based I/O: when the pipe event
fires, the async task is rescheduled through the executor before resuming.
That extra scheduling hop means proc_pidinfo is called slightly later than
with spawn_blocking, which uses a dedicated OS thread that calls proc_pidinfo
synchronously right after the read returns with no scheduler hop in between.
On a loaded CI runner that window is large enough for the process state to
change, causing proc_pidinfo to return None and the CPU subtraction to be
skipped.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@datadog-datadog-prod-us1-2

This comment has been minimized.

Base automatically changed from rochdev/ready-signal to main June 4, 2026 20:59
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.

1 participant