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 — Socket: Add half-closure tests to SocketHalfClosedTest by rajan-github · Pull Request #17394 · netty/netty

Conversation

@rajan-github

@rajan-github rajan-github commented Sep 7, 2026 •
edited by normanmaurer
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Motivation:

SocketHalfClosedTest lacked test coverage verifying that active, unilateral
local half-closure calls (shutdownInput() and shutdownOutput()) correctly
permit the opposite direction to continue functioning with actual data
payload transfer.

Modifications:

Add testShutdownInputAllowsOutboundWrites and
testShutdownOutputAllowsInboundReads to SocketHalfClosedTest using
DuplexChannel.

Also remove unused imports and fix a checkstyle violation in
NioSocketChannelTest.

Result:

Improve test coverage for transport-agnostic half-closure behavior,
ensuring outbound writes succeed after shutdownInput() and inbound reads
succeed after shutdownOutput().

Sorry, something went wrong.

Uh oh!

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

All reactions
@normanmaurer

normanmaurer commented Sep 7, 2026

Copy link
Copy Markdown
Member

@rajan-github I think these are already covered by our testsuite module. What I am missing ?

All reactions

Sorry, something went wrong.

Uh oh!

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

@rajan-github

rajan-github commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @normanmaurer, Thanks for taking a look!

while the testsuite module (specifically SocketHalfClosedTest) thoroughly covers channel options (AUTO_CLOSE, ALLOW_HALF_CLOSURE) and passive event handling when a peer disconnects, these tests target two specific programmatic half-closure gaps:

  1. Active shutdownInput() followed by Outbound Writes:
    testShutdownInputAllowsOutboundWrites explicitly calls channel.shutdownInput() locally and asserts that channel.writeAndFlush(...) still successfully transmits outbound data to the peer afterward.

  2. Active shutdownOutput() followed by Inbound Reads:
    testShutdownOutputAllowsInboundReads explicitly calls channel.shutdownOutput() locally and asserts that the channel pipeline continues to receive and process new incoming payloads from the peer.

Existing tests like testAllDataReadAfterHalfClosure focus on draining buffers when receiving a FIN from the remote peer, but don't explicitly validate active, unilateral local shutdownInput() or shutdownOutput() calls while keeping the opposite direction functional.

I initially wrote these against raw JDK sockets to isolate NioSocketChannel, but I can easily refactor both scenarios into SocketHalfClosedTest using DuplexChannel. That way, we get these explicit read/write payload assertions running across all transports (Nio, Epoll, KQueue).

Would you prefer I refactor them into SocketHalfClosedTest?

All reactions

Sorry, something went wrong.

Uh oh!

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

@normanmaurer

normanmaurer commented Sep 8, 2026

Copy link
Copy Markdown
Member

Yes

rajan-github reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@rajan-github

rajan-github commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @normanmaurer ! I've refactored the tests into SocketHalfClosedTest using DuplexChannel so they run across all transports. PTAL! If there are any further changes needed, please let me know.

All reactions

Sorry, something went wrong.

Uh oh!

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

@normanmaurer

normanmaurer commented Sep 9, 2026

Copy link
Copy Markdown
Member

@rajan-github please squash and fix / update the commit message to match what you did

All reactions

Sorry, something went wrong.

Uh oh!

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

@rajan-github
rajan-github force-pushed the test/nio-socket-channel branch from b5c605e to 8e2be24 Compare September 10, 2026 01:43
@rajan-github

rajan-github commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@normanmaurer Done, thanks! I squashed the commits into a single commit and updated the commit message to accurately reflect the changes. The PR branch has been force-updated with the cleaned-up history.

All reactions

Sorry, something went wrong.

Uh oh!

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

@normanmaurer normanmaurer changed the title NioSocketChannel: Add tests for half-closure operations with MultiThreadIoEventLoopGroup Socket: Add half-closure tests to SocketHalfClosedTes Sep 10, 2026
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 10, 2026
@normanmaurer normanmaurer changed the title Socket: Add half-closure tests to SocketHalfClosedTes Socket: Add half-closure tests to SocketHalfClosedTest Sep 10, 2026
normanmaurer
normanmaurer reviewed Sep 10, 2026
View reviewed changes
Comment thread testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java Resolved

Uh oh!

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

normanmaurer
normanmaurer reviewed Sep 10, 2026
View reviewed changes
Comment thread testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java Resolved

Uh oh!

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

normanmaurer
normanmaurer reviewed Sep 10, 2026
View reviewed changes
Comment thread testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java Resolved

Uh oh!

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

normanmaurer
normanmaurer requested changes Sep 10, 2026
View reviewed changes
@rajan-github
rajan-github force-pushed the test/nio-socket-channel branch from 9ed98c4 to 2edee0b Compare September 11, 2026 03:28
@rajan-github
Motivation:
0da098c
SocketHalfClosedTest lacked test coverage verifying that active, unilateral
local half-closure calls (shutdownInput() and shutdownOutput()) correctly
permit the opposite direction to continue functioning with actual data
payload transfer.

Modifications:

Add testShutdownInputAllowsOutboundWrites and
testShutdownOutputAllowsInboundReads to SocketHalfClosedTest using
DuplexChannel.

Also remove unused imports and fix a checkstyle violation in
NioSocketChannelTest.

Result:

Improve test coverage for transport-agnostic half-closure behavior,
ensuring outbound writes succeed after shutdownInput() and inbound reads
succeed after shutdownOutput().
@rajan-github
rajan-github force-pushed the test/nio-socket-channel branch from 2edee0b to 0da098c Compare September 11, 2026 03:38
@rajan-github
rajan-github requested a review from normanmaurer September 11, 2026 03:57
@testlens-app

testlens-app Bot commented Sep 11, 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 / linux-x86_64-java25 build > Netty/Handler/Ssl/Ocsp

Test Runs Flakiness
OcspServerCertificateValidatorTest ❌ 1% 🟡

🏷️ Commit: 0da098c
▶️ Tests: 424882 executed
⚪️ Checks: 29/29 completed

Test Failures

OcspServerCertificateValidatorTest (Netty/Handler/Ssl/Ocsp in Build PR / linux-x86_64-java25 build)
java.lang.IllegalStateException: Possible memory leak detected for resource scope 'OcspServerCertificateValidatorTest'. Please use paranoid leak detection to get more information, or set -Dio.netty.util.LeakPresenceDetector.trackCreationStack=true
	at io.netty.util.LeakPresenceDetector$ResourceScope.check(LeakPresenceDetector.java:308)
	at io.netty.util.LeakPresenceDetector$ResourceScope.close(LeakPresenceDetector.java:328)
	at io.netty.util.test.LeakPresenceExtension.afterAll(LeakPresenceExtension.java:140)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

Rerun Controls

Select tests to mute in this pull request:

  • OcspServerCertificateValidatorTest

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 added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Sep 11, 2026
normanmaurer
normanmaurer approved these changes Sep 11, 2026
View reviewed changes
@normanmaurer
normanmaurer merged commit e8aaef5 into netty:4.2 Sep 11, 2026
29 of 30 checks passed

Uh oh!

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

@netty-project-bot

netty-project-bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 4.1.

All reactions

Sorry, something went wrong.

Uh oh!

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

@netty-project-bot

netty-project-bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17433

All reactions

Sorry, something went wrong.

Uh oh!

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

@netty-project-bot netty-project-bot mentioned this pull request Sep 11, 2026
Auto-port 5.0: Socket: Add half-closure tests to SocketHalfClosedTest #17433
Merged
@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 11, 2026
normanmaurer added a commit that referenced this pull request Sep 14, 2026
@netty-project-bot @rajan-github @normanmaurer
Auto-port 5.0: Socket: Add half-closure tests to SocketHalfClosedTest (…
04dc820
…#17433)

Auto-port of #17394 to 5.0
Cherry-picked commit: e8aaef5

---
Motivation:

SocketHalfClosedTest lacked test coverage verifying that active,
unilateral
local half-closure calls (shutdownInput() and shutdownOutput())
correctly
permit the opposite direction to continue functioning with actual data
payload transfer.

Modifications:

Add testShutdownInputAllowsOutboundWrites and
testShutdownOutputAllowsInboundReads to SocketHalfClosedTest using
DuplexChannel.

Also remove unused imports and fix a checkstyle violation in
NioSocketChannelTest.

Result:

Improve test coverage for transport-agnostic half-closure behavior,
ensuring outbound writes succeed after shutdownInput() and inbound reads
succeed after shutdownOutput().

---------

Co-authored-by: Rajan Chauhan <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>
normanmaurer added a commit that referenced this pull request Sep 14, 2026
@normanmaurer @rajan-github
Socket: Add half-closure tests to SocketHalfClosedTest (#17394) (#17434)
b1f65ed
Motivation:

SocketHalfClosedTest lacked test coverage verifying that active,
unilateral
local half-closure calls (shutdownInput() and shutdownOutput())
correctly
permit the opposite direction to continue functioning with actual data
payload transfer.

Modifications:

Add testShutdownInputAllowsOutboundWrites and
testShutdownOutputAllowsInboundReads to SocketHalfClosedTest using
DuplexChannel.

Also remove unused imports and fix a checkstyle violation in
NioSocketChannelTest.

Result:

Improve test coverage for transport-agnostic half-closure behavior,
ensuring outbound writes succeed after shutdownInput() and inbound reads
succeed after shutdownOutput().

---------

Co-authored-by: Rajan Chauhan <[email protected]>
@normanmaurer normanmaurer mentioned this pull request Sep 15, 2026
deprecation 41 698270e9 #17487
Closed
@normanmaurer normanmaurer mentioned this pull request Oct 1, 2026
child5 #17695
Closed
@normanmaurer normanmaurer removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Oct 16, 2026
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
@normanmaurer @rajan-github @lltopk
Socket: Add half-closure tests to SocketHalfClosedTest (netty#17394) (n…
f9b1c42
…etty#17434)

Motivation:

SocketHalfClosedTest lacked test coverage verifying that active,
unilateral
local half-closure calls (shutdownInput() and shutdownOutput())
correctly
permit the opposite direction to continue functioning with actual data
payload transfer.

Modifications:

Add testShutdownInputAllowsOutboundWrites and
testShutdownOutputAllowsInboundReads to SocketHalfClosedTest using
DuplexChannel.

Also remove unused imports and fix a checkstyle violation in
NioSocketChannelTest.

Result:

Improve test coverage for transport-agnostic half-closure behavior,
ensuring outbound writes succeed after shutdownInput() and inbound reads
succeed after shutdownOutput().

---------

Co-authored-by: Rajan Chauhan <[email protected]>
@normanmaurer normanmaurer mentioned this pull request Oct 26, 2026
crisp nova cceda091 #18109
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

4.2.19.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@rajan-github @normanmaurer @netty-project-bot
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.