GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — zlib: avoid an extra empty zstd frame by marcopiraccini · Pull Request #66161 · nodejs/node

Conversation

@marcopiraccini

@marcopiraccini marcopiraccini commented Sep 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

createZstdCompress() could append an empty frame when end() was called while writes were still queued. The last queued chunk could finish the frame, then the stream's final flush sent ZSTD_e_end again with no input.

Track when the frame has ended and skip empty calls until more input arrives. This avoids the extra frame while still allowing a later write to start a new one.

Added test/parallel/test-zlib-zstd-compress-single-frame.js to cover queued writes, explicit frame endings, an empty flush, an empty stream, and a later frame.

Fixes: #66078

Note

PR #66091 proposed the same C++ fix but was closed without merging. This PR expands the regression coverage to include an empty flush after a completed frame, an empty stream, and a deliberate second frame, alongside queued writes and an explicit end flush. The empty flush completes before end() so the test exercises ZSTD_e_flush separately.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib module and its compression dependencies. labels Sep 20, 2026
@marcopiraccini
marcopiraccini marked this pull request as ready for review September 20, 2026 15:22
@codecov

codecov Bot commented Sep 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.35%. Comparing base (75e4bbe) to head (3833a92).
⚠️ Report is 542 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66161      +/-   ##
==========================================
- Coverage   90.36%   90.35%   -0.02%     
==========================================
  Files         792      792              
  Lines      275398   275430      +32     
  Branches    52776    52787      +11     
==========================================
- Hits       248877   248869       -8     
- Misses      16937    16984      +47     
+ Partials     9584     9577       -7     
Files with missing lines Coverage Δ
src/node_zlib.cc 80.30% <100.00%> (+0.08%) ⬆️

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

meixg
meixg approved these changes Sep 21, 2026
View reviewed changes
@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 21, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 21, 2026
@nodejs-github-bot

nodejs-github-bot commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/77689/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ShogunPanda
ShogunPanda approved these changes Sep 21, 2026
View reviewed changes

@ShogunPanda ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell
jasnell approved these changes Sep 21, 2026
View reviewed changes
@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. labels Sep 25, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Sep 25, 2026
@nodejs-github-bot

nodejs-github-bot commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/77875/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts with its base branch, removing the author ready label.
Please rebase your branch onto the latest base branch, resolve the conflicts locally, and force-push.
Afterwards the pull request needs a fresh collaborator approval, and a collaborator will add the label back once it is author ready again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcopiraccini
zlib: avoid an extra empty zstd frame
3833a92
Signed-off-by: marcopiraccini <[email protected]>
@marcopiraccini
marcopiraccini force-pushed the zstd-empty-frame branch from b0ce1f4 to 3833a92 Compare September 28, 2026 05:02
ShogunPanda
ShogunPanda approved these changes Oct 11, 2026
View reviewed changes
@bricss

bricss commented Oct 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Would be great to see 👁️ this bug 🐞 fix 🪛 shipped 🚀 coz outputs 📤 of createZstdCompress and zstdCompress doesn't ❌ match anymore.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bricss bricss mentioned this pull request Oct 23, 2026
2026-10-28, Version 26.13.0 'Lithium' (LTS) #66965
Merged
@ShogunPanda ShogunPanda added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 26, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 26, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78669/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@robobun robobun mentioned this pull request Oct 27, 2026
node:zlib: zstd pledgedSrcSize and dictionary follow Node v26.12.1 oven-sh/bun#47027
Closed
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78694/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@viceice viceice mentioned this pull request Oct 28, 2026
Guard against the empty trailing zstd frame from createZstdCompress renovatebot/osv-offline#2279
Closed
@bricss bricss mentioned this pull request Oct 28, 2026
2026-10-28, Version 27.0.0-alpha.0.0.0 (Alpha) #67062
Merged
@MikeMcC399 MikeMcC399 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Oct 28, 2026
@MikeMcC399

MikeMcC399 commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@bricss

Would be great to see 👁️ this bug 🐞 fix 🪛 shipped 🚀 coz outputs 📤 of createZstdCompress and zstdCompress doesn't ❌ match anymore.

You have been requesting this for the Node.js 27.0.0-alpha.0.0.0 release and for the 26.13.0 release. In terms of general rules:

  • Releases can only ship pull requests that have landed, and this pull request is still open. Even if it is now merged into the main branch I would expect it to have to wait for the next 27.x release before it is picked up.

  • Node.js 26.x is planned to become the Active LTS release today, that means any new commits have to have been in a "Current" release previously for a minimum of 2 weeks to prove stability.

Edit: It has now landed, so it should be a candidate for the follow-on 27.0.0-alpha.x.x.x release. In the past, "Current" releases have had a cadence of 2 weeks between releases.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ShogunPanda ShogunPanda added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Oct 29, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 1d3835e into nodejs:main Oct 29, 2026
73 of 74 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Landed in 1d3835e

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 29, 2026
aduh95 pushed a commit that referenced this pull request Nov 11, 2026
@marcopiraccini @aduh95
zlib: avoid an extra empty zstd frame
bf7bef4
Signed-off-by: marcopiraccini <[email protected]>
PR-URL: #66161
Fixes: #66078
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
2026-11-12, Version 27.0.0-alpha.0.1.0 (Alpha) #67415
Merged
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@marcopiraccini @aduh95
zlib: avoid an extra empty zstd frame
3791c7b
Signed-off-by: marcopiraccini <[email protected]>
PR-URL: #66161
Fixes: #66078
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@marcopiraccini @gabylb
zlib: avoid an extra empty zstd frame
27ecbe1
Signed-off-by: marcopiraccini <[email protected]>
PR-URL: nodejs#66161
Fixes: nodejs#66078
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ShogunPanda ShogunPanda ShogunPanda approved these changes
@jasnell jasnell jasnell approved these changes
@meixg meixg meixg approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib module and its compression dependencies.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

zlib: createZstdCompress appends an empty frame when end() is called with writes still queued

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@marcopiraccini @nodejs-github-bot @bricss @MikeMcC399 @ShogunPanda @jasnell @meixg @panva
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.