Repository navigation
fix: deliver pending utilityProcess messages before emitting exit - #54956
Merged
Merged
Conversation
…4924) * fix: deliver pending utilityProcess messages before emitting exit HandleTermination closed the parentPort connector before emitting 'exit', so messages the child had posted but the browser had not dispatched yet were dropped. The connector dispatches one message per task, and the exit notification can already be queued ahead of those tasks, so a child that posts several messages and then calls process.exit() lost all but the first. Dispatch whatever is already queued on the port before closing it. Browser shutdown still closes the port without dispatching, since the child is still running then. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS * test: extract sleepSync helper and drop utility-process ack handshake Move the Atomics.wait() call in the utilityProcess message-before-exit test into a documented sleepSync() spec helper. With pending parentPort messages now dispatched before 'exit', the api-net-spec.js fixture can post its result and exit right away again, so remove the ack handshake that #54901 added as a workaround, along with the error logging that covered the wait for the ack. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS (cherry picked from commit 4a802b0) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS
3 tasks done
dsanders11
approved these changes
Oct 14, 2026
ckerr
approved these changes
Oct 15, 2026
|
Release Notes Persisted
|
Contributor
|
I was unable to backport this PR to "43-x-y" cleanly; |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54960 |
This was referenced Oct 15, 2026
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.
Description of Change
Manually backport #54924. See that PR for details.
The only conflict was in
HandleTermination()inshell/browser/api/electron_api_utility_process.cc, where 45-x-y lacks theBrowserChildProcessObserverbookkeeping from #53992, so the newDispatchPendingMessages()call was placed beforeCloseConnectorPort()without that line; all spec changes applied cleanly.Checklist
npm testpasses🤖 Generated with Claude Code
https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS
Release Notes
Notes: Fixed
utilityProcessdropping messages posted withprocess.parentPort.postMessage()right before the process exits.Generated by Claude Code