Repository navigation
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
There was a problem hiding this comment.
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, andBackpressureDecompressionHandlerto 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 resettingreadingtofalseifheldBackis 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
heldBackis empty and no messages were written, the method returnsfalsewhilereadingis stilltrue. This violates the method’s ownassert !readingcontract for future invocations and can prevent laterchannelRead(...)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_OUTPUTpath, if no message was written, the method callsctx.read()and returnsfalsebut leavesreading = true. Resettingreadingbefore 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.
yawkat
left a comment
There was a problem hiding this comment.
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.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]> Co-Authored-By: multicode <[email protected]>
🔎 No tests executed 🔎🏷️ Commit: 83524f1 Learn more about TestLens at testlens.app/docs. |
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]>
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:
BackpressureGauge,AbstractBackpressureDecompressionHandler, andBackpressureDecompressionHandlerfrom New decompressor API #15667.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=falseAll 11 reactor projects passed.
codec-compressionran 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.