Skip to content

[COR-24160] Add Client.CloseIdleConns to close one server's idle connections - #9

Merged
ethanlin-coding merged 1 commit into
masterfrom
ethanlin/COR-24160_close-idle-conns-per-addr
Oct 20, 2026
Merged

ethanlin-coding merged 1 commit into
masterfrom
ethanlin/COR-24160_close-idle-conns-per-addr

Conversation

@ethanlin-coding

Copy link
Copy Markdown

Summary

This adds Client.CloseIdleConns(addr), which closes the idle connections to one server, because Client.Close can 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 ./memcache for the new test and the existing timeout tests.

Details

  • vaccel's per-node circuit breaker drains the idle pool when a node's breaker opens, so the half-open probe dials a fresh connection instead of drawing a dead one. With Close that 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. CloseIdleConns lets vaccel drain only the failing node.
  • Relates to COR-24160

🤖 Generated with Claude Code

…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.
@ethanlin-coding
ethanlin-coding requested a review from a team as a code owner October 20, 2026 16:47
@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

COR-24160

@ethanlin-coding
ethanlin-coding merged commit 1606713 into master Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants