Skip to content

fix: deliver utilityProcess output written just before the child exits - #54262

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/utility-process-trailing-stdio
Sep 24, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix/utility-process-trailing-stdio

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

When the child exited, utilityProcess removed every listener from the child.stdout / child.stderr streams it hands out, so output the child wrote just before exiting (still in the pipe, or read but not yet emitted) never reached 'data' listeners. The streams are now left alone and end once the pipe has been drained; a stream that never got connected is ended on exit so readers don't wait forever. child.stdout / child.stderr still read as null after 'exit', as documented.

The stdout/stderr property specs and the electron/lol import spec read whatever had arrived by 'exit', which is how this showed up; they now wait for the expected output.

Checklist

Release Notes

Notes: Fixed utilityProcess dropping stdout/stderr output that the child wrote immediately before exiting.

… exited

When the child exited, utilityProcess removed every listener from the
stdout/stderr streams it hands out, so output the child wrote just before
exiting (still in the pipe, or read but not yet emitted) never reached
'data' listeners. Leave the streams alone and let them end once the pipe
has been drained; only end a stream that never got connected. child.stdout
and child.stderr still read as null after 'exit', as documented.

The stdout/stderr property specs and the electron/lol import spec read
whatever had arrived by 'exit' and so failed whenever the last chunk came
late; they now wait for the expected output.
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 24, 2026
@MarshallOfSound MarshallOfSound self-assigned this Sep 24, 2026
@MarshallOfSound MarshallOfSound added the target/42-x-y PR should also be added to the "42-x-y" branch. label Sep 24, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 24, 2026 01:04
@MarshallOfSound
MarshallOfSound merged commit d847824 into main Sep 24, 2026
106 checks passed
@MarshallOfSound
MarshallOfSound deleted the fix/utility-process-trailing-stdio branch September 24, 2026 02:10
@release-clerk

release-clerk Bot commented Sep 24, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed utilityProcess dropping stdout/stderr output that the child wrote immediately before exiting.

@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/42-x-y PR should also be added to the "42-x-y" branch. label Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "45-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/42-x-y and removed target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #54278

@trop trop Bot added in-flight/44-x-y and removed target/44-x-y PR should also be added to the "44-x-y" branch. labels Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #54279

@trop trop Bot added in-flight/43-x-y merged/44-x-y PR was merged to the "44-x-y" branch. and removed target/43-x-y PR should also be added to the "43-x-y" branch. in-flight/44-x-y in-flight/43-x-y labels Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "42-x-y", please check out #54332

@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "45-x-y", please check out #54335

dsanders11 pushed a commit that referenced this pull request Sep 25, 2026
…s (45-x-y) (#54335)

fix: deliver utilityProcess output written just before the child exits (#54262)

fix: deliver utilityProcess output that was still in the pipe when it exited

When the child exited, utilityProcess removed every listener from the
stdout/stderr streams it hands out, so output the child wrote just before
exiting (still in the pipe, or read but not yet emitted) never reached
'data' listeners. Leave the streams alone and let them end once the pipe
has been drained; only end a stream that never got connected. child.stdout
and child.stderr still read as null after 'exit', as documented.

The stdout/stderr property specs and the electron/lol import spec read
whatever had arrived by 'exit' and so failed whenever the last chunk came
late; they now wait for the expected output.

(cherry picked from commit d847824)
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Sep 25, 2026
MarshallOfSound added a commit that referenced this pull request Sep 25, 2026
…s (42-x-y) (#54332)

fix: deliver utilityProcess output written just before the child exits (#54262)

fix: deliver utilityProcess output that was still in the pipe when it exited

When the child exited, utilityProcess removed every listener from the
stdout/stderr streams it hands out, so output the child wrote just before
exiting (still in the pipe, or read but not yet emitted) never reached
'data' listeners. Leave the streams alone and let them end once the pipe
has been drained; only end a stream that never got connected. child.stdout
and child.stderr still read as null after 'exit', as documented.

The stdout/stderr property specs and the electron/lol import spec read
whatever had arrived by 'exit' and so failed whenever the last chunk came
late; they now wait for the expected output.

(cherry picked from commit d847824)
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants