Repository navigation
fix(platform-node-shared): keep a proxy process whose reply waits behind a blocked event loop - #11008
Open
juliusmarminge wants to merge 7 commits into
Open
juliusmarminge wants to merge 7 commits into
juliusmarminge wants to merge 7 commits into
Conversation
…ind a blocked event loop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 02c8d1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
This branch is waiting to be deployed
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.
layerProxyProcessstops the proxy process when a reply takes longer thanresponseTimeout. That can kill a healthy proxy process when the application's own event loop is blocked. If the loop is blocked past the deadline right after a spawn request is sent, Node runs the due timer before it reads the proxy process's reply, which is already waiting on the IPC channel. The spawn then fails, and every command the proxy process was running loses its exit status.With this change, a request's
responseTimeouttimer no longer stops the proxy process directly. It schedules asetImmediate, which runs after Node has read any queued replies, and the proxy process is stopped only if that request's timer is still registered. The timer stays unref'd. The immediate is referenced, so an idle event loop runs it straight away instead of waiting for unrelated I/O.Deadlines are still per request. Messages for other commands do not extend a missing reply's timeout, and a silent proxy process still times out on schedule.
Test
keeps a proxy process whose reply waits behind a blocked event loopstarts a spawn with a 1 sresponseTimeout, blocks the event loop withAtomics.waituntil the child has started and the deadline has passed, then asserts that the spawn succeeds and a second spawn reuses the same proxy process.does not send a command again when its acknowledgement is lostnow also runs unrelated spawns on the same proxy process during the timeout window, to check that they do not keep the unanswered request alive.Closes EFF-4636