Repository navigation
[COR-24160] Add Client.CloseIdleConns to close one server's idle connections - #9
Merged
ethanlin-coding merged 1 commit intoOct 20, 2026
Conversation
…ections Client.Close closes the idle connections to every server. CloseIdleConns closes only those to one address, so a caller that knows one server is unhealthy can discard its pooled connections without making the client redial the healthy servers.
andrii-korotkov-verkada
approved these changes
Oct 20, 2026
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.
Summary
This adds
Client.CloseIdleConns(addr), which closes the idle connections to one server, becauseClient.Closecan only drop every server's idle connections at once.Testing
TestCloseIdleConnsClosesOnlyAddr: with idle connections to two servers, closing one address closes its connections, keeps the other server's open, and the client dials the closed address again on demand.go test -race ./memcachefor the new test and the existing timeout tests.Details
Closethat drain also drops the healthy nodes' connections, and since every pod trips at about the same time, every pod redials (TLS) all healthy nodes together.CloseIdleConnslets vaccel drain only the failing node.🤖 Generated with Claude Code