Repository navigation
Auto-port 4.1: POOL: Close active unhealthy channels on release - #17319
Merged
Merged
Conversation
Motivation: When a custom `ChannelHealthChecker` reports an active channel as unhealthy during release, `SimpleChannelPool` removes the channel from pool ownership and does not return it to storage, but leaves it open. The release future still succeeds, so the active channel is no longer owned by either the caller or the pool. Modification: - Close channels rejected by the release health check after invoking `channelReleased()`. - Add a regression test with a custom health checker that rejects an active channel and verifies callback ordering, release success, and channel closure. Result: Active unhealthy channels are successfully discarded without changing the `channelReleased()` callback ordering or release promise semantics. Tests: `./mvnw -pl transport -Dtest=SimpleChannelPoolTest,FixedChannelPoolTest test` (cherry picked from commit 2f8818f)
✅ All tests passed ✅🏷️ Commit: bb9f099 Learn more about TestLens at testlens.app/docs. |
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
Oct 24, 2026
…y#17319) Auto-port of netty#17306 to 4.1 Cherry-picked commit: 2f8818f --- Motivation: When a custom `ChannelHealthChecker` reports an active channel as unhealthy during release, `SimpleChannelPool` removes the channel from pool ownership and does not return it to storage, but leaves it open. The release future still succeeds, so the active channel is no longer owned by either the caller or the pool. Modification: - Close channels rejected by the release health check after invoking `channelReleased()`. - Add a regression test with a custom health checker that rejects an active channel and verifies callback ordering, release success, and channel closure. Result: Active unhealthy channels are successfully discarded without changing the `channelReleased()` callback ordering or release promise semantics. Tests: `./mvnw -pl transport -Dtest=SimpleChannelPoolTest,FixedChannelPoolTest test` --------- Co-authored-by: Gimin Kim <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Auto-port of #17306 to 4.1
Cherry-picked commit: 2f8818f
Motivation:
When a custom
ChannelHealthCheckerreports an active channel as unhealthy during release,SimpleChannelPoolremoves the channel from pool ownership and does not return it to storage, but leaves it open. The release future still succeeds, so the active channel is no longer owned by either the caller or the pool.Modification:
channelReleased().Result:
Active unhealthy channels are successfully discarded without changing the
channelReleased()callback ordering or release promise semantics.Tests:
./mvnw -pl transport -Dtest=SimpleChannelPoolTest,FixedChannelPoolTest test