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 — Port: Codec-compression: Add BrotliDecompressor by chrisvest · Pull Request #17171 · netty/netty

Conversation

@chrisvest

@chrisvest chrisvest commented Jul 28, 2026

Copy link
Copy Markdown
Member

Motivation:

The decompressor API migration tracked in #16743 needs per-format
implementations split into independently reviewable changes. Brotli
support is one of the remaining formats after the core decompressor API
landed in #16745.

Modification:

  • Add BrotliDecompressor using the new Decompressor API.
  • Add BrotliDecompressorTest using the shared decompressor contract
    tests.
  • Fix BrotliEncoder close handling so the finish future returned
    during close is completed by the writer.

Result:

Brotli now has a reusable decompressor implementation that can be used
without a channel-based decoder, and the codec-compression module
verifies successfully.

Part of #16743.


Co-authored-by: multicode [email protected]

(cherry picked from commit b8fb58f)

Sorry, something went wrong.

Uh oh!

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

All reactions
yawkat and others added 2 commits July 28, 2026 11:45
@yawkat @chrisvest
Codec-compression: Add BrotliDecompressor (netty#17146)
50176da
Motivation:

The decompressor API migration tracked in netty#16743 needs per-format
implementations split into independently reviewable changes. Brotli
support is one of the remaining formats after the core decompressor API
landed in netty#16745.

Modification:

- Add `BrotliDecompressor` using the new `Decompressor` API.
- Add `BrotliDecompressorTest` using the shared decompressor contract
tests.
- Fix `BrotliEncoder` close handling so the finish future returned
during close is completed by the writer.

Result:

Brotli now has a reusable decompressor implementation that can be used
without a channel-based decoder, and the codec-compression module
verifies successfully.

Part of netty#16743.

---------

Co-authored-by: multicode <[email protected]>

(cherry picked from commit b8fb58f)
@chrisvest
BrotliEncoder: Complete the completion handler on close
33678d4
@chrisvest chrisvest added this to the 5.0.0.Final milestone Jul 28, 2026
@chrisvest chrisvest mentioned this pull request Jul 28, 2026
Codec-compression: Add BrotliDecompressor #17146
Merged
@chrisvest
chrisvest requested a review from yawkat July 28, 2026 18:59
@chrisvest

chrisvest commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@yawkat Had to redo the BrotliEncoder changes for 5.0.

yawkat 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.

yawkat
yawkat approved these changes Jul 28, 2026
View reviewed changes
@yawkat
yawkat requested a review from Copilot July 28, 2026 19:02
Copilot AI reviewed Jul 28, 2026
View reviewed changes

Copilot AI 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.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds Brotli support to the new Decompressor API and aligns Brotli encoder shutdown semantics with the channel writer’s completion lifecycle.

Changes:

  • Introduce BrotliDecompressor implementing the new Decompressor API (with a builder).
  • Add BrotliDecompressorTest based on the shared decompressor contract tests.
  • Fix BrotliEncoder close/finish handling so the close promise is completed by the writer.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliDecompressor.java New reusable Brotli decompressor implementation using DecoderJNI.Wrapper.
codec-compression/src/test/java/io/netty/handler/codec/compression/BrotliDecompressorTest.java Contract-style tests for Brotli decompression behavior and edge conditions.
codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java Adjusts close/finish wiring so close completion is driven by the writer’s finish future.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliDecompressor.java Resolved

Uh oh!

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

Comment thread codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java
Comment on lines 191 to 193
private final ChannelHandlerContext ctx;
private final Promise<Void> closeFuture;
private boolean isClosed;
Comment thread codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java
Comment on lines 246 to 254
public void close() {
final Promise<Void> promise = ctx.newPromise();

ctx.executor().execute(new Runnable() {
@Override
public void run() {
try {
finish(promise);
} catch (IOException ex) {
promise.setFailure(new IllegalStateException("Failed to finish encoding", ex));
}
ctx.executor().execute(() -> {
try {
finish(closeFuture);
} catch (IOException ex) {
closeFuture.setFailure(new IllegalStateException("Failed to finish encoding", ex));
}
});
}
Comment thread codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliDecompressor.java Resolved

Uh oh!

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

Comment thread codec-compression/src/main/java/io/netty/handler/codec/compression/BrotliDecompressor.java Resolved

Uh oh!

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

Copilot started reviewing on behalf of yawkat July 28, 2026 19:32
View session
@yawkat @multicode-agent
BrotliEncoder: Prevent duplicate close scheduling
8add94d
Co-Authored-By: multicode <[email protected]>
@yawkat

yawkat commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

fixed the same issue in #17175

All reactions

Sorry, something went wrong.

Uh oh!

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

normanmaurer and others added 2 commits August 4, 2026 02:23
@normanmaurer
Merge branch '5.0' into 5.0-brotli-decompressor
d3f6202
@chrisvest
Fix compilation
40190b7
@chrisvest
chrisvest enabled auto-merge (squash) August 4, 2026 22:42
chrisvest added 3 commits August 5, 2026 09:12
@chrisvest
Merge branch '5.0' into 5.0-brotli-decompressor
302bea7
@chrisvest
Merge branch '5.0' into 5.0-brotli-decompressor
6815225
@chrisvest
Fix the test failures by using the correct close future for BrotliEnc…
edfc7c6
…oder
@chrisvest

chrisvest commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Ok, I think this should pass now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@testlens-app

testlens-app Bot commented Aug 7, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: edfc7c6
▶️ Tests: 40743 executed
⚪️ Checks: 12/12 completed


Learn more about TestLens at testlens.app.

All reactions

Sorry, something went wrong.

Uh oh!

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

@chrisvest
chrisvest disabled auto-merge August 10, 2026 18:41
@chrisvest
chrisvest merged commit 8692f4d into netty:5.0 Aug 10, 2026
12 of 13 checks passed

Uh oh!

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

@chrisvest
chrisvest deleted the 5.0-brotli-decompressor branch August 10, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yawkat yawkat yawkat approved these changes
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@chrisvest @yawkat @normanmaurer
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.