Repository navigation
perf(host-kit): read Linux process identity from /proc before ps - #5212
Conversation
The selected-pid identity snapshot ran `ps` and then replaced state and start token from `/proc` for every listed row. Read `/proc` first and run one batch `ps` only for the pids it left unread. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Size Report
Startup median (7 runs, lower is better):
Affected plugins
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Async identity reads (snapshot and ownership) now use fs/promises for /proc, including the re-read of each pid ps lists. The blocking snapshot stays synchronous. Stop and read types move to the type-only module, so host-process.ts stays at its line limit and no import closure gains a module. The registration-read test hides /proc, so its positive control and its main assertion both observe identity reads on Linux. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
No problem that needs a code change was found at d294adc: Linux selected-PID snapshots read All 22 checks pass at this commit. The earlier Linux Coverage failure in the daemon-client metadata test does not recur, and the test now hides Not verified here: behavior on a real Linux host and the latency gain were not checked, so Linux behavior rests on the code, the platform-faked unit tests and the Linux CI run. Not verified here: it was not confirmed on a Linux host that Not blocking: these can be taken or left: Could host-kit own one test-only Two earlier inline threads no longer apply: the blocking async read is fixed because the async snapshot now reads through No code change is needed before merge. |
The daemon-client test claims a non-Linux platform instead of keeping its own `/proc` fake. The snapshot retry test covers both conflicting zombie states. Two comments now match the code. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Review notes applied in e2e82f7.
Local checks on macOS: both changed test files, 46 passed and 6 Linux-only skipped; with a Linux host simulated, 52 passed. The four retry cases fail if |
This comment has been minimized.
This comment has been minimized.
…roc-first Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * origin/main: perf(apple): reuse the process identity for native-build cache locks (#5203) perf(apple): read the native-build toolchain identity with two concurrent probes (#5206) perf(macos): reuse the helper fingerprint between unchanged calls (#5207) docs(agents): add performance guidance (#5208) perf(daemon): classify a device claim owner only for refusals and settlement (#5210)
Linux process identity now reads /proc through fs.promises too, so hiding only readFileSync let the lock's off-loop read remember a linux: token. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The PR is ready at 84acff5. Not blocking: this can be taken or left: the new The other earlier notes are addressed: All 21 checks pass at this commit, including the Linux jobs that ran the changed tests. Two earlier inline threads no longer apply: the blocking async read is fixed because async reads go through Not verified here: behavior on a real Linux host and the latency gain are unmeasured, so Linux behavior rests on the code, the platform-faked unit tests and Linux CI. Not verified here: the rejection of a Nothing else is needed before merge. |
Summary
On Linux the selected-PID identity snapshot ran
ps, then replaced state and start token with/procfacts for every listed row. It now reads/procfirst and runs one batchpsonly for the PIDs left unread. Async identity reads (snapshot and ownership) read/procthroughfs/promises. macOS and Windows still use their process tools; token formats are unchanged.Intended change: a PID that
/procanswers is observed even whenpsfails, times out or omits it. Unread PIDs behave as before.Out of scope: the ownership read still needs
psfor command lines.Stop and Windows row types moved to the type-only module, keeping
host-process.tsat 1000 lines without adding a module to any import closure.Tests that count process-tool runs hide
/procor claim a non-Linux platform.Validation
Tested d294adc on macOS.
Process-tool runs per snapshot, counted by tests with Linux faked:
tscpassed.🤖 Generated with Claude Code