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 — Codec-compression: Add backpressure decompression handlers by yawkat · Pull Request #17161 · netty/netty

Conversation

@yawkat

@yawkat yawkat commented Jul 28, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Motivation:

The decompressor API migration in #15667 is being split into smaller, independently reviewable changes as tracked by #16743. The core API and decompressor implementations are available on 4.2, but the generic backpressure-aware handler infrastructure is not.

Modification:

  • Add BackpressureGauge, AbstractBackpressureDecompressionHandler, and BackpressureDecompressionHandler from New decompressor API #15667.
  • Preserve decompressor state and buffer ownership across manual reads, failures, end-of-input, and reentrant handler removal.
  • Bound manual reads that consume compressed input without producing output.
  • Add focused backpressure and read-complete tests.
  • Run the existing FastLZ, Bzip2, Snappy, Brotli, JDK zlib, LZ4, LZF, and Zstd decoder/integration suites through the new handler.
  • Keep the new APIs marked unstable while the migration is in progress.

Result:

Pull-based decompressors can be installed as channel handlers with bounded manual-read output and read-complete propagation. Existing 4.2 decompressor implementations are covered through the handler without adding HTTP/1.1, HTTP/2, or additional format work.

Verification:

./mvnw -B -ntp -pl codec-compression -am verify -Dcheckstyle.skip=false

All 11 reactor projects passed. codec-compression ran 700 tests with no failures or errors, and Checkstyle completed successfully. The nine newly added algorithm handler classes ran 93 focused tests with no failures, errors, or skips.

Part of #16743.

Sorry, something went wrong.

Uh oh!

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

All reactions
yawkat and others added 5 commits July 28, 2026 08:08
@yawkat @multicode-agent
Codec-compression: Add backpressure decompression handlers
12e29fc
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test Bzip2 backpressure decompression
086bc00
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test FastLZ backpressure decompression
487e11f
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test Snappy backpressure decompression
eb5528c
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Avoid held message array allocation
4625c6a
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat
yawkat requested a review from Copilot July 28, 2026 08:59
Copilot started reviewing on behalf of yawkat July 28, 2026 09:03
View session
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

This PR ports the generic backpressure-aware decompression handler infrastructure into codec-compression (as part of the staged decompressor API migration), and routes existing format test suites through the new handler to validate behavior.

Changes:

  • Add BackpressureGauge, AbstractBackpressureDecompressionHandler, and BackpressureDecompressionHandler to support bounded, manual-read-aware decompression.
  • Add focused unit tests for backpressure/read-complete behavior and handler-removal edge cases.
  • Re-run existing FastLZ/Bzip2/Snappy decoder and integration tests through the new handler via thin adapter test classes.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
codec-compression/src/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java New shared implementation for backpressure-aware decompression with manual-read support.
codec-compression/src/main/java/io/netty/handler/codec/compression/BackpressureDecompressionHandler.java Concrete ChannelHandler adapter that wires a Decompressor into the shared backpressure logic.
codec-compression/src/main/java/io/netty/handler/codec/compression/BackpressureGauge.java New backpressure accounting/config component (messages/bytes per read).
codec-compression/src/test/java/io/netty/handler/codec/compression/BackpressureDecompressionHandlerTest.java New focused tests for backpressure, end-of-input, message replay, and re-entrant removal.
codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2DecoderTest.java Adjust teardown/exception handling path for tests that expect failures.
codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2DecompressorHandlerIntegrationTest.java Runs existing Bzip2 integration suite through BackpressureDecompressionHandler.
codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2DecompressorHandlerTest.java Runs existing Bzip2 decoder tests through BackpressureDecompressionHandler.
codec-compression/src/test/java/io/netty/handler/codec/compression/FastLzDecompressorHandlerIntegrationTest.java Runs existing FastLZ integration suite through BackpressureDecompressionHandler.
codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyDecompressorHandlerIntegrationTest.java Runs existing Snappy integration suite through BackpressureDecompressionHandler.
codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyDecompressorHandlerJumboSizeIntegrationTest.java Runs existing Snappy jumbo-size integration suite through BackpressureDecompressionHandler.
codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecoderTest.java Refactors to allow swapping decoder implementation in derived tests.
codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecompressorHandlerTest.java Runs existing Snappy frame decoder tests through BackpressureDecompressionHandler.
Comments suppressed due to low confidence (3)

codec-compression/src/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java:247

  • Same issue as above: after reading = true, this second guard-return (after computing decompressor status) can return without resetting reading to false if heldBack is changed reentrantly, leaving the handler in an inconsistent state.
        if (this.heldBack != heldBack) {
            return false;
        }

codec-compression/src/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java:253

  • When heldBack is empty and no messages were written, the method returns false while reading is still true. This violates the method’s own assert !reading contract for future invocations and can prevent later channelRead(...) calls from resetting the per-read bookkeeping.
            if (heldBack.isEmpty() && !anyMessageWrittenSinceReadStart) {
                heldBack.recycle();
                return false;
            } else {

codec-compression/src/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java:274

  • In the NEED_OUTPUT path, if no message was written, the method calls ctx.read() and returns false but leaves reading = true. Resetting reading before issuing a read avoids incorrectly treating the subsequent inbound read as re-entrant within the previous read cycle.
            ctx.read();
            return false;

💡 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 ...c/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java Resolved

Uh oh!

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

yawkat
yawkat commented Jul 28, 2026
View reviewed changes

@yawkat yawkat left a comment

Copy link
Copy Markdown
Contributor Author

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.

Focused follow-up on manual-read accounting and trailing input handling. I did not raise the handler-removal or non-ByteBuf points; the latter is consistent with this handler's explicit ByteBuf-only contract despite differing from ByteToMessageDecoder pass-through behavior.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread ...c/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java Resolved

Uh oh!

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

Comment thread ...c/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java Resolved

Uh oh!

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

Comment thread ...c/main/java/io/netty/handler/codec/compression/AbstractBackpressureDecompressionHandler.java Resolved

Uh oh!

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

yawkat and others added 10 commits July 28, 2026 14:16
@yawkat @multicode-agent
Codec-compression: Reject trailing Bzip2 data
5dd5285
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Preserve reentrant decompression reads
13aefd3
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Bound no-output decompression reads
2ad5dba
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Clear read state on handler removal
71a9a20
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Merge branch '4.2' into pr-16743-backpressure-decompression
261ca39
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test Brotli backpressure decompression
560c88e
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test JDK zlib backpressure decompression
31ef5b3
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test LZ4 backpressure decompression
c05f11d
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test LZF backpressure decompression
177e8d8
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@yawkat @multicode-agent
Codec-compression: Test Zstd backpressure decompression
83524f1
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

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

Co-Authored-By: multicode <[email protected]>
@testlens-app

testlens-app Bot commented Jul 28, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

🔎 No tests executed 🔎

🏷️ Commit: 83524f1
▶️ Tests: 0 executed
⚪️ Checks: 19/19 completed


Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

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

yawkat added a commit that referenced this pull request Sep 26, 2026
@yawkat
Merge #17161: Codec-compression: Add backpressure decompression handlers
f04e33b
yawkat added a commit that referenced this pull request Sep 26, 2026
@yawkat @claude
Rebuild HTTP decompression on merged 4.2 decompressor APIs
dc4f7c1
Motivation:

Most of this PR has been split out and merged to 4.2 (#16745, #17145-#17155),
and the backpressure handler is under review in #17161. The split versions
received review fixes that this branch does not have, which left the PR
conflicting with 4.2 in every decompressor.

Modification:

* Take the merged 4.2 decompressor implementations and the #17161 version of
  the backpressure handler infrastructure.
* Re-apply the remaining unmerged parts of this PR on top: HTTP/1.1
  HttpDecompressionHandler, HTTP/2 DecompressingFrameListener, their tests,
  and deprecation of the legacy decoders.
* Drop JZlib support (JZlibDecompressor, ZlibDecompressor base class,
  ZlibCodecFactory decompressor builder). HttpDecompressionHandler uses
  JdkZlibDecompressor directly.
* Restore BackpressureGauge.relieveBackpressure(long), which #17161 removed
  but DecompressingFrameListener needs for HTTP/2 flow-control credit.

Result:

The PR applies cleanly on 4.2 again and only carries the unmerged parts of
#16743.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

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