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 — fix(netty): fail a capped inflate buffer only once it is full, as Netty 4.2.19 does by mkurz · Pull Request #2366 · AsyncHttpClient/async-http-client

Conversation

@mkurz

@mkurz mkurz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • main fails Http1ContentDecompressorTest.aBufferThatCannotGrowFailsLikeNetty on every platform and JDK since Inflate HTTP/1.1 gzip and deflate without an EmbeddedChannel #2357 and Bump the dependencies group with 29 updates #2364 (Netty 4.2.19) were both merged.
  • Netty 4.2.19 includes Only fail in ZlibDecoder when the decompression buffer is full netty/netty#17692: ZlibDecoder fails with "Decompression buffer has reached maximum size" only once the buffer cannot grow and is also full. The HTTP/1.1 inflate loop from Inflate HTTP/1.1 gzip and deflate without an EmbeddedChannel #2357 copies the check from before that change.
  • Add the same condition to the loop, and let the test compare both cases with Netty.

Problem

The inflate loop grows its output buffer after every unfinished step, as ZlibDecoder.prepareDecompressBuffer does, so that a buffer that cannot grow fails at the same point as with Netty. Up to 4.2.18, Netty failed as soon as ensureWritable(preferredSize, true) returned 1, even if the buffer still had room. Since 4.2.19 it keeps inflating into the space that is left and fails only once nothing is writable.

aBufferThatCannotGrowFailsLikeNetty feeds a flushed raw deflate stream of 900 random bytes into a buffer capped at 1024 bytes. Netty 4.2.19 decodes it; the loop still failed it, so the test's comparison fails. The "Build PR" run on b9dbb212a failed on all 12 test jobs with this test alone.

Change

  • Http1ContentDecompressor: fail only if ensureWritable(...) == 1 && !decompressed.isWritable(), as ZlibDecoder does now.
  • aBufferThatCannotGrowFailsLikeNetty compares two cases with Netty: output that fits into the capped buffer is decoded, and output that overflows it (64 KiB of zeros) fails with Netty's message. Both still check that the inputs are released.

The test from #2357 caught this; thanks @pavel-ptashyts.

AI disclosure

Claude Code on behalf of Matthias Kurz. The commit includes Co-Authored-By per AGENTS.md.

Test plan

  • On main (b9dbb212a), JDK 11: aBufferThatCannotGrowFailsLikeNetty fails in 3 of 3 runs, as in CI.
  • With the change, Http1ContentDecompressorTest passes: 28 tests, including its comparisons with Netty over more than 300 scenarios.
  • Without the code change, the new test fails in the "output fits" case, with the error main shows; the "output overflows" case fails the same way in both decoders.
  • ./mvnw -B -ntp -Dgpg.skip=true clean verify on JDK 11: 1,819 tests, 0 failures, 0 errors, 11 skipped; Revapi passed. No test-skipping flags were used.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mkurz @claude
Fail a capped inflate buffer only once it is full
ca88638
The HTTP/1.1 inflate loop from AsyncHttpClient#2357 fails the response once its
output buffer cannot grow, as JdkZlibDecoder did, so that both fail at
the same point. Netty 4.2.19, which main uses since AsyncHttpClient#2364, fails only
once the buffer cannot grow and is also full (netty/netty#17692), and
keeps inflating into the space that is left. Since both were merged,
aBufferThatCannotGrowFailsLikeNetty fails on main: Netty decodes a
stream whose output still fits into the capped buffer, and the loop
fails it.

Add the same condition. The test now checks both cases against
Netty: output that fits is decoded, and output that overflows the
buffer fails with Netty's message.

Claude Code on behalf of Matthias Kurz

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mkurz

mkurz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@hyperxpro This fixes the test that has failed main's CI on every platform since #2357 and the Netty 4.2.19 bump (#2364). The replay fix you asked me to split out of #2362 needs a green build before I open it, and the #2362 rebuild follows that, so I'd be grateful if you could look at this one first.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mkurz

mkurz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@hyperxpro just a reminder, if you can merge this one, I can continue my other pull requests, thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@hyperxpro
hyperxpro merged commit c7d720d into AsyncHttpClient:main Nov 4, 2026
13 checks passed

Uh oh!

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

@hyperxpro

hyperxpro commented Nov 4, 2026

Copy link
Copy Markdown
Member

Thanks a lot!

All reactions

Sorry, something went wrong.

Uh oh!

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

@mkurz
mkurz deleted the fix/inflate-buffer-full-check branch November 4, 2026 18:42
@mkurz mkurz mentioned this pull request Nov 4, 2026
fix(netty): stop inflating a suspended HTTP/1.1 response #2362
Merged
14 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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

@mkurz @hyperxpro
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.