util/retry: create dynamic retry mechanism#162104
util/retry: create dynamic retry mechanism#162104kev-cao wants to merge 1 commit intocockroachdb:masterfrom
Conversation
|
To see this in action, check out: cockroach/pkg/backup/restore_job.go Lines 233 to 327 in f46a232 This doesn't use the multiple states functionality, but it does take advantage of the ability to reset the retry mechanism or fast fail. The purpose of this mechanism it to facilitate the work for #159388, namely the approach outlined here. |
pkg/util/retry/dynamic_retry.go
Outdated
| func NewState(state string) newState { | ||
| return newState{state: state} | ||
| } |
There was a problem hiding this comment.
This would be so much more succinct with Rust enums, wouldn't need the separate TransitionKind or all this boilerplate with interfaces 😢
8c1285e to
5d5ba0c
Compare
Potential Bug(s) DetectedThe three-stage Claude Code analysis has identified potential bug(s) in this PR that may warrant investigation. Next Steps: Note: When viewing the workflow output, scroll to the bottom to find the Final Analysis Summary. After you review the findings, please tag the issue as follows:
|
5d5ba0c to
9df0f8e
Compare
|
Wrote up what this would look like on backup: |
This commit creates a dynamic retry mechanism wrapper around `retry.Retry`. This mechanism allows for multiple retry policies that the caller can switch between after each attempt. Epic: None Release note: None
9df0f8e to
a017b37
Compare
This commit creates a dynamic retry mechanism wrapper around
retry.Retry. This mechanism allows for multiple retry policies that the caller can switch between after each attempt.Epic: None
Release note: None