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 — HTTP/2: Drain queued frames stranded by a writability change during flush (#17279) by normanmaurer · Pull Request #17281 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Aug 13, 2026

Copy link
Copy Markdown
Member

Motivation:

The inFlush guard added in #17266 (fixing livelock #17256) drops a
flush that
re-enters via a synchronous writability change. But when
writePendingBytes()
leaves frames queued and the following ctx.flush() drains the transport
and
flips the channel writable mid-flush, that dropped flush was the only
signal to
write the rest — so large writes (e.g. a multi-MiB gRPC body) hang.

Modification:

  • Gate the writability-driven flush: channelWritabilityChanged only
    flushes when
    the remote flow controller still has frames queued, so a writability
    toggle
    with nothing to write (e.g. SslHandler during setup) can't drive the
    flush -> writability -> flush livelock (Netty HTTP/2 client livelock — reentrant flush during pipeline setup #17256).
  • flush() re-runs while a flush was requested reentrantly while it was
    running,
    honoring it regardless of writability; the inFlush guard turns that
    reentrancy
    into iteration rather than recursion.

Result:

Large HTTP/2 writes no longer stall on a mid-flush writability flip, and

Sorry, something went wrong.

Uh oh!

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

All reactions
@bryce-anderson @normanmaurer
HTTP/2: Drain queued frames stranded by a writability change during f…
5885648
…lush (#17279)

Motivation:

The `inFlush` guard added in #17266 (fixing livelock #17256) drops a
flush that
re-enters via a synchronous writability change. But when
writePendingBytes()
leaves frames queued and the following ctx.flush() drains the transport
and
flips the channel writable mid-flush, that dropped flush was the only
signal to
write the rest — so large writes (e.g. a multi-MiB gRPC body) hang.

Modification:

- Gate the writability-driven flush: channelWritabilityChanged only
flushes when
the remote flow controller still has frames queued, so a writability
toggle
  with nothing to write (e.g. SslHandler during setup) can't drive the
  flush -> writability -> flush livelock (#17256).
- flush() re-runs while a flush was requested reentrantly while it was
running,
honoring it regardless of writability; the inFlush guard turns that
reentrancy
  into iteration rather than recursion.

Result:

Large HTTP/2 writes no longer stall on a mid-flush writability flip, and
@normanmaurer normanmaurer mentioned this pull request Aug 13, 2026
HTTP/2: Drain queued frames stranded by a writability change during flush #17279
Merged
@testlens-app

testlens-app Bot commented Aug 13, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Build PR / macos-aarch64-java25-boringssl build > Netty/Transport/Native/KQueue

Test Runs Flakiness
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeDirectByteBuf(TestInfo) ❌ ✅ 5% 🟠
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeHeapByteBuf(TestInfo) ❌ ✅ 1% 🟡

Build PR / macos-x86_64-java25-boringssl build > Netty/Transport/Native/KQueue

Test Runs Flakiness
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeHeapByteBuf(TestInfo) ❌ ✅ 1% 🟡

Build PR / windows-x86_64-java25-boringssl > Netty/Buffer

Test Runs Flakiness
SlicedByteBufTest > testCopyMultipleThreads0() ⚠️ 🚫 0% 🟢

Build PR / windows-x86_64-java25-boringssl > Netty/Common

Test Runs Flakiness
AutoScalingEventExecutorChooserFactoryTest > testScaleUp() ✅ ❌ 1% 🟡

🏷️ Commit: 5885648
▶️ Tests: 2973 executed
⚪️ Checks: 12/12 completed

Test Failures

AutoScalingEventExecutorChooserFactoryTest > testScaleUp() (Netty/Common in Build PR / windows-x86_64-java25-boringssl)
org.opentest4j.AssertionFailedError: Should scale up to 2 after stressing one executor. ==> expected: <2> but was: <3>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:563)
	at io.netty.util.concurrent.AutoScalingEventExecutorChooserFactoryTest.testScaleUp(AutoScalingEventExecutorChooserFactoryTest.java:152)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
expected actual
2 3

Muted Tests

Select tests to mute in this pull request:

  • AutoScalingEventExecutorChooserFactoryTest > testScaleUp()
  • KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeDirectByteBuf(TestInfo)
  • KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeHeapByteBuf(TestInfo)
  • SlicedByteBufTest > testCopyMultipleThreads0()

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app.

All reactions

Sorry, something went wrong.

Uh oh!

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

@normanmaurer
normanmaurer merged commit 50ebe4c into 5.0 Aug 13, 2026
19 of 23 checks passed

Uh oh!

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

@normanmaurer
normanmaurer deleted the h2_5 branch August 13, 2026 13:06
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Aug 13, 2026
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

5.0.0.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@normanmaurer @bryce-anderson
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.