- Notifications
You must be signed in to change notification settings - Fork351
Skip expired backfills instead of returning error#1674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| }) | ||
| // Depends on pendingReleaseTimeout | ||
| time.Sleep(1*time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a bit ugly, would be nice if we could have something likek8s.io/utils/clock/testing to pass the time
7924516 tof31067dCompareIf a single backfill has expired it would cause the whole FetchMatchescall to error out. Now the backfill will be skipped instead similar tothe NotFound case. The status code returned for attempting toacknowledge or update an expired backfill is changed from Unavailablesince the operation is not retryable.
f31067d to7fc3eb3Compare| iferr!=nil { | ||
| e,ok:=status.FromError(err) | ||
| iferr==errBackfillGenerationMismatch|| (ok&&e.Code()==codes.NotFound) { | ||
| iferr==errBackfillGenerationMismatch|| (ok&&(e.Code()==codes.NotFound||e.Code()==codes.FailedPrecondition)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is the main change
What this PR does / Why we need it:
If a single backfill has expired it would cause the whole FetchMatches call to error out. Now instead the backfill will be skipped, similar to the
NotFoundcase.The status code returned for attempting to acknowledge or update an expired backfill is changed from Unavailable since the operation is not retryable. I opted for
FailedPrecondition, but maybeInvalidArgumentcould make more sense since you can't "revive" the backfill, only create a new one if it expired.Special notes for your reviewer:
There are some formatting changes from format-on-save, let me know if I should remove them to make the PR clearer.