-
Notifications
You must be signed in to change notification settings - Fork 22
Fix hanging graceful channel shutdown by cleaning up state. #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Corrects two scenarios where stale state in the load balancer could prevent a graceful channel shutdown. Previously, multiple endpoint updates or changes to the load balancer could leave undiscarded subchannels or old load balancers in the channel's state, blocking a clean shutdown. This change ensures that previous subchannels and load balancers are fully removed from state when they shutdown. This also corrects a related test, which had been passing incorrectly due to an explicit cancellation masking the issue.
glbrntt
requested changes
Aug 4, 2025
Collaborator
glbrntt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but the formatter isn't happy. ./dev/format.sh should fix it.
...s/GRPCNIOTransportCoreTests/Client/Connection/LoadBalancers/PickFirstLoadBalancerTests.swift
Outdated
Show resolved
Hide resolved
glbrntt
approved these changes
Aug 4, 2025
Collaborator
glbrntt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
dongjoon-hyun
added a commit
to apache/spark-connect-swift
that referenced
this pull request
Aug 26, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `gRPC Swift NIO Transport` to 2.1.0. ### Why are the changes needed? To bring the latest improvements. - https://github.com/grpc/grpc-swift-nio-transport/releases/tag/2.1.0 - grpc/grpc-swift-nio-transport#122 - grpc/grpc-swift-nio-transport#120 - grpc/grpc-swift-nio-transport#115 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #218 from dongjoon-hyun/SPARK-53371. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun
added a commit
to apache/spark-connect-swift
that referenced
this pull request
Aug 26, 2025
### What changes were proposed in this pull request? This PR aims to upgrade `gRPC Swift NIO Transport` to 2.1.0. ### Why are the changes needed? To bring the latest improvements. - https://github.com/grpc/grpc-swift-nio-transport/releases/tag/2.1.0 - grpc/grpc-swift-nio-transport#122 - grpc/grpc-swift-nio-transport#120 - grpc/grpc-swift-nio-transport#115 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #218 from dongjoon-hyun/SPARK-53371. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit a94af2e) Signed-off-by: Dongjoon Hyun <[email protected]>
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.
Corrects two scenarios where stale state in the load balancer could prevent a graceful channel shutdown.
Previously, multiple endpoint updates or changes to the load balancer could leave undiscarded subchannels or old load balancers in the channel's state, blocking a clean shutdown.
This change ensures that previous subchannels and load balancers are fully removed from state when they shutdown. This also corrects a related test, which had been passing incorrectly due to an explicit cancellation masking the issue.