-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker: flush stdout and stderr on exit #56428
Conversation
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56428 +/- ##
==========================================
- Coverage 88.54% 88.53% -0.01%
==========================================
Files 657 658 +1
Lines 190393 190822 +429
Branches 36552 36627 +75
==========================================
+ Hits 168582 168947 +365
- Misses 14998 15048 +50
- Partials 6813 6827 +14
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than linting, LGTM.
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
@jasnell @ShogunPanda PTAL, this should be good now. |
I've handled another bad case I identified. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Commit Queue failed- Loading data for nodejs/node/pull/56428 ✔ Done loading data for nodejs/node/pull/56428 ----------------------------------- PR info ------------------------------------ Title worker: flush stdout and stderr on exit (#56428) Author Matteo Collina <[email protected]> (@mcollina) Branch mcollina:worker-thread-stdout -> nodejs:main Labels worker, lts-watch-v20.x, lts-watch-v22.x Commits 4 - worker: flush stdout and stderr on exit - fixup - fixup - fixup Committers 1 - Matteo Collina <[email protected]> PR-URL: https://github.com/nodejs/node/pull/56428 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/56428 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Wed, 01 Jan 2025 22:54:12 GMT ✔ Approvals: 2 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/56428#pullrequestreview-2530942296 ✔ - Paolo Insogna (@ShogunPanda) (TSC): https://github.com/nodejs/node/pull/56428#pullrequestreview-2527130910 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-01-05T18:01:05Z: https://ci.nodejs.org/job/node-test-pull-request/64354/ - Querying data for job/node-test-pull-request/64354/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 56428 From https://github.com/nodejs/node * branch refs/pull/56428/merge -> FETCH_HEAD ✔ Fetched commits as b736028c7f62..de200d845ba6 -------------------------------------------------------------------------------- [main 42373cf1d9] worker: flush stdout and stderr on exit Author: Matteo Collina <[email protected]> Date: Thu Dec 26 13:42:47 2024 +0100 1 file changed, 28 insertions(+) create mode 100644 test/parallel/test-worker-stdio-flush.js [main 1e1e3e5ca0] fixup Author: Matteo Collina <[email protected]> Date: Wed Jan 1 17:52:26 2025 -0500 2 files changed, 4 insertions(+), 1 deletion(-) [main 32a1594f30] fixup Author: Matteo Collina <[email protected]> Date: Sat Jan 4 20:23:48 2025 -0500 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 test/parallel/test-worker-stdio-flush-inflight.js [main 43ecc894e7] fixup Author: Matteo Collina <[email protected]> Date: Sat Jan 4 21:01:08 2025 -0500 3 files changed, 21 insertions(+), 27 deletions(-) ✔ Patches applied There are 4 commits in the PR. Attempting autorebase. Rebasing (2/8) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- worker: flush stdout and stderr on exithttps://github.com/nodejs/node/actions/runs/12623476751 |
Landed in b0c65bb |
This fix an old problem I had since forever when using worker threads, stdout log lines being cut if the thread exited. This PR fixes it by bypassing backpressure if the thread is exiting.