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 — Port 4.2: LocalChannel: Deliver data written by the peer before it closed (#17814) by normanmaurer · Pull Request #17816 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Oct 14, 2026

Copy link
Copy Markdown
Member

Motivation:

OpenSslPrivateKeyMethodTest.testPrivateKeyMethod failed once on CI
because
the client channel became inactive without ever receiving the PONG the
server wrote right before it closed.

When the peer writes while this channel has writeInProgress set,
runFinishTask0() submits the finishReadTask and stores its future in
finishReadFuture. When that task runs, finishPeerRead0() sees its own
future as not done and re-queues the task, which places it behind the
tryClose task the peer already scheduled. tryClose() then closes the
channel and releaseInboundBuffers() drops the data the peer wrote before
closing. This differs from TCP, where data received before the FIN is
still readable.

Modification:

Call finishPeerRead0(this) in tryClose() before closing an active
channel,
so already queued inbound data is delivered first. Add a regression test
that keeps the client inside doWrite(...) while the peer writes and
closes.

Result:

Data written by a LocalChannel peer before it closes is no longer lost.

Sorry, something went wrong.

Uh oh!

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

All reactions
@normanmaurer
Port 4.2: LocalChannel: Deliver data written by the peer before it cl…
9291d80
…osed (#17814)

Motivation:

OpenSslPrivateKeyMethodTest.testPrivateKeyMethod failed once on CI
because
the client channel became inactive without ever receiving the PONG the
server wrote right before it closed.

When the peer writes while this channel has writeInProgress set,
runFinishTask0() submits the finishReadTask and stores its future in
finishReadFuture. When that task runs, finishPeerRead0() sees its own
future as not done and re-queues the task, which places it behind the
tryClose task the peer already scheduled. tryClose() then closes the
channel and releaseInboundBuffers() drops the data the peer wrote before
closing. This differs from TCP, where data received before the FIN is
still readable.

Modification:

Call finishPeerRead0(this) in tryClose() before closing an active
channel,
so already queued inbound data is delivered first. Add a regression test
that keeps the client inside doWrite(...) while the peer writes and
closes.

Result:

Data written by a LocalChannel peer before it closes is no longer lost.
@normanmaurer normanmaurer mentioned this pull request Oct 14, 2026
LocalChannel: Deliver data written by the peer before it closed #17814
Merged
@normanmaurer normanmaurer added this to the 4.2.20.Final milestone Oct 14, 2026
@testlens-app

testlens-app Bot commented Oct 14, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 17816

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

Test Runs Flakiness
KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo) ❌ 2% 🟡

🏷️ Commit: 9291d80
▶️ Tests: 21168 executed
🟡 Checks: 25/26 completed

Test Failures

KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java11-boringssl build)
java.util.concurrent.TimeoutException: testAllDataReadClosure(org.junit.jupiter.api.TestInfo) timed out after 20000 milliseconds
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	Suppressed: java.lang.InterruptedException
		at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)
		at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
		at java.base/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:784)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:692)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest$16.run(SocketHalfClosedTest.java:684)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest$16.run(SocketHalfClosedTest.java:681)
		at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:681)
		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
		... 2 more

Rerun Controls

Note

Checks are currently running using the configuration below.

Select tests to mute in this pull request:

🔲 KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo)

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/docs.

All reactions

Sorry, something went wrong.

Uh oh!

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

@normanmaurer
normanmaurer merged commit aa00c11 into 4.2 Oct 14, 2026
25 of 27 checks passed

Uh oh!

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

@normanmaurer
normanmaurer deleted the local_close42 branch October 14, 2026 19:36
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

4.2.20.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

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