client: reduce membership refreshes during transport outages#11037
client: reduce membership refreshes during transport outages#11037rleungx wants to merge 1 commit into
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMember refresh gains failure classification, per-URL episode tracking, degraded-mode connection inspection, scheduled-refresh suppression, recovery logging, and service-client integration. Tests cover error contracts, state transitions, concurrency, logging, allocation behavior, and benchmarks. ChangesMember refresh failure control
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant updateMemberLoop
participant memberRefreshController
participant PD
participant memberFailureTracker
participant serviceDiscovery
updateMemberLoop->>memberRefreshController: evaluate member URLs and connection states
memberRefreshController->>PD: request member updates when retry is required
PD-->>serviceDiscovery: members or classified failure
serviceDiscovery->>memberFailureTracker: record failure or recover URL
memberFailureTracker-->>serviceDiscovery: suppression or summary state
serviceDiscovery->>updateMemberLoop: update clients and retry scheduling
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Ryan Leung <rleungx@gmail.com>
b630e07 to
989aee5
Compare
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md. |
What problem does this PR solve?
During a sustained PD transport outage, asynchronous membership-check triggers can keep
checkMembershipChpopulated. Each trigger starts a fresh one-secondGetMembersretry batch, so fast failures can produce continuous RPC bursts and per-URL logs.This is related to #11020, but intentionally addresses both the repeated RPCs and the logs rather than adding a process-wide sampler.
What is changed and how does it work?
IDLE,CONNECTING, orTRANSIENT_FAILUREgRPC connection.GetMembers;ClientConnstate every 100 ms;Connect()forIDLEconnections;READY, missing, shut down, or the URL set changes;CheckMemberChangedimmediate and unsuppressed.The controller uses only structured signals (
ErrGRPCDial, gRPC status codes, PD error types, URL identity, and gRPC connectivity state). Error-message text is not used for control decisions or classification.Compatibility and correctness
updateMemberremains a compatibility wrapper and returns the existing error unchanged.Tests
go test ./servicediscovery -count=1go test -race ./servicediscovery -count=1make staticinclient/READY/IDLE/missing/SHUTDOWNstates, URL replacement, error contracts, logging, cleanup, and concurrent failure tracking.Benchmarks on darwin/amd64:
Summary by CodeRabbit
New Features
Bug Fixes
Tests