Close the pty write-after-respawn race and bound the pty PATH resolve stall - #205
Open
rakibulism wants to merge 1 commit into
Open
Close the pty write-after-respawn race and bound the pty PATH resolve stall#205rakibulism wants to merge 1 commit into
rakibulism wants to merge 1 commit into
Conversation
… stall
ptySpawn now returns a versioned PtyHandle{key, generation}; ptyWriteChecked
refuses a write whose generation no longer matches the current occupant of
that key, closing a misdelivery hazard where a stale write could land on a
respawned pty that reused the same key. ts_core_host.zig's spawn/write path
now uses it.
resolveExecutable's PATH walk (blocking access() calls with no timeout) now
runs on a bounded worker thread via resolveExecutableBounded, capped at
300ms before the worker is abandoned rather than stalling the loop thread
indefinitely on a wedged NFS/autofs mount.
Also adds a real-executor test for the deferred (non-inline) host-request
answer path racing cancelHostRequest, closing a coverage gap in
effects_host_tests.zig.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@rakibulism is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ptySpawnnow returns a versionedPtyHandle{key, generation}; a newptyWriteCheckedrefuses a write whose generation no longer matches the current occupant of that key. This closes a misdelivery hazard where a stale write (issued for an old pty occupant) could silently land on a new pty that reused the same key.ts_core_host.zig's spawn/write path now uses it.resolveExecutable's PATH walk (blockingaccess()calls with no timeout) now runs on a bounded worker thread viaresolveExecutableBounded, capped at 300ms before the worker is abandoned — a stalled NFS/autofs mount now costs the loop thread a bounded stall instead of hanging indefinitely.cancelHostRequest, closing a coverage gap ineffects_host_tests.zig— previously every real-executorrequest_fnstub answered synchronously inline, so the genuinely async path (feedHostResultcalled later, offrequest_fn's own call stack) was untested.Test plan
zig build testpasses locally (Zig 0.16.0) with the same set of pre-existing, environment-gated failures (missing codesigning identity, no Android SDK, etc.) as an unmodified checkout — nothing new broken.zig ast-checkclean on every edited file.resolveExecutableBoundedon every spawn) runs and passes.