V22 add consul retry - #910
Draft
sbaker617 wants to merge 5 commits into
Draft
Conversation
Introduces a kvClient interface wrapper (retryKV) that transparently retries consul KV operations on transient network errors and 5xx responses. Configurable via flags, enabled by default. Covers Get, List, Keys, Txn — all operations used by file.go, directory.go, watch.go, and election.go. Lock lifecycle operations are intentionally not retried. Flags: --topo_consul_retry_count (default 3) --topo_consul_retry_base_delay (default 250ms) --topo_consul_retry_max_delay (default 5s) --topo_consul_retry_enabled (default true) Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Steve Baker <s.baker@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Steve Baker <s.baker@slack-corp.com>
rand.Int64N(0) panics if baseDelay is set to 0 via flag. Return zero duration immediately when the computed delay is non-positive. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Steve Baker <s.baker@slack-corp.com>
Replace time.Sleep with a select on ctx.Done and time.After so that retries abort promptly when the caller's context is canceled or expired. Pass context from callers in file.go, directory.go, and election.go via QueryOptions so the retry loop can observe it. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Steve Baker <s.baker@slack-corp.com>
A retried CAS transaction can return a spurious conflict if the original commit succeeded but the response was lost. Document that this is inherent and not worse than the no-retry baseline. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Steve Baker <s.baker@slack-corp.com>
sbaker617
force-pushed
the
v22-add-consul-retry
branch
from
August 12, 2026 23:34
778c813 to
d61e4eb
Compare
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.
Description
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure