Merged
Conversation
Motivation: We should ensure our decompressing decoders will fire their buffers through the pipeliner as fast as possible and so allow the user to take ownership of these as fast as possible. This is needed to reduce the risk of OOME as otherwise a small input might produce a large amount of data that can't be processed until all the data was decompressed in a loop. Beside this we also should ensure that other handlers that uses these decompressors will not buffer all of the produced data before processing it, which was true for HTTP and HTTP2. Modifications: - Adjust affected decoders (Brotli, Zstd and ZLib) to fire buffers through the pipeline as soon as possible - Adjust HTTP / HTTP2 decompressors to do the same - Add testcase. Result: Less risk of OOME when doing decompressing Co-authored-by: yawkat <jonas.konrad@oracle.com>
zekronium
reviewed
Feb 10, 2026
Comment on lines
-161
to
-172
| try { | ||
| Http2LocalFlowController flowController = connection.local().flowController(); | ||
| decompressor.incrementDecompressedBytes(padding); | ||
| for (;;) { | ||
| ByteBuf nextBuf = nextReadableBuf(channel); | ||
| boolean decompressedEndOfStream = nextBuf == null && endOfStream; | ||
| if (decompressedEndOfStream && channel.finish()) { | ||
| nextBuf = nextReadableBuf(channel); | ||
| decompressedEndOfStream = nextBuf == null; | ||
| } | ||
|
|
||
| decompressor.incrementDecompressedBytes(buf.readableBytes()); |
There was a problem hiding this comment.
@normanmaurer Here where previously padding was incrementDecompressedBytes but later on removed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
We should ensure our decompressing decoders will fire their buffers through the pipeliner as fast as possible and so allow the user to take ownership of these as fast as possible. This is needed to reduce the risk of OOME as otherwise a small input might produce a large amount of data that can't be processed until all the data was decompressed in a loop. Beside this we also should ensure that other handlers that uses these decompressors will not buffer all of the produced data before processing it, which was true for HTTP and HTTP2.
Modifications:
Result:
Less risk of OOME when doing decompressing