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 — test: let the auto-read-off replay test accept a chunk delivered before the replay by mkurz · Pull Request #2368 · AsyncHttpClient/async-http-client

Conversation

@mkurz

@mkurz mkurz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the flaky ResponseBodyControlTest.ioExceptionReplayDrainsTheOldConnectionWithAutoReadDisabled, added in fix(netty): detach a replayed request's old channel before completing its body control #2367. It failed on macOS with JDK 21 in fix(netty): detach a replayed request's old channel before completing its body control #2367's first CI run, and about once in ten runs locally.
  • Test only; the fix from fix(netty): detach a replayed request's old channel before completing its body control #2367 is unchanged.

Problem

The test's server sends the first response's chunk right after its head. When both arrive in the same read, the handler receives the chunk before the injected I/O error replays the request. That is correct, since a suspension does not hold back what has already been read, but the test took the chunk for part of the replayed body (expected: <replayed> but was: <first>).

Recording the order of events over 50 repetitions on JDK 11: 3 runs had the chunk before onRetry, none after it.

Change

The test records onRetry, allows the first response's chunk only before it, and checks that the replayed body follows it directly. What the test is about is unchanged: with auto-read off, the old connection must still be drained and closed.

AI disclosure

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

Test plan

  • The test repeated 50 times on JDK 11 and on JDK 25: 0 failures. The previous version failed 7 times on JDK 11 and once on JDK 25.
  • Without fix(netty): detach a replayed request's old channel before completing its body control #2367's change in NettyRequestSender, every one of 50 repetitions still fails, on the drain assertion.
  • ./mvnw -B -ntp -Dgpg.skip=true clean verify on JDK 11, on a tree identical to this branch: 1,821 tests, 0 failures, 0 errors, 11 skipped; Revapi passed. No test-skipping flags were used.
  • ResponseBodyControlTest and Http2ResponseBodyControlTest, compiled on JDK 11 and run on JDK 17, 21 and 25 (Maven Surefire's -Djvm): 20 tests each, 0 failures.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mkurz @claude
Let the replay drain test accept an early chunk
df72340
ioExceptionReplayDrainsTheOldConnectionWithAutoReadDisabled failed in
about one run in ten, as on macOS with JDK 21 in CI. The server sends
the first response's chunk right after its head; when both arrive in
the same read, the handler receives the chunk before the I/O error
replays the request. That is correct, but the test took the chunk for
part of the replayed body.

Record onRetry, allow the first chunk only before it, and check that
the replayed body follows it directly. Over 50 repetitions, the old
assertion failed 7 times on JDK 11 and once on JDK 25, the new one
never, and every failure had the chunk before onRetry. Without the fix
in NettyRequestSender, the test still fails every time.

Claude Code on behalf of Matthias Kurz

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

mkurz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Green 😉

hyperxpro reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

hyperxpro
hyperxpro approved these changes Nov 4, 2026
View reviewed changes
@hyperxpro
hyperxpro merged commit 05624c4 into AsyncHttpClient:main Nov 4, 2026
13 checks passed

Uh oh!

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

@mkurz
mkurz deleted the fix/replay-drain-test-race branch November 4, 2026 19:54
@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

@hyperxpro hyperxpro hyperxpro approved these changes

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.