-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retry: fix retry.WithMaxAttempt to deal with opt.Closer properly #47063
Conversation
Welcome back, creator. Thank you for testing me. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I have added a few people who may be able to assist in reviewing: 🦉 Hoot! I am a Blathers, a bot for CockroachDB. I am experimental - my owner is otan. |
❌ The GitHub CI (Cockroach) build has failed on 20923a8c. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. I am experimental - my owner is otan. |
4149bdc
to
c5c88cd
Compare
Woah good catch! @tbg this may be of interest. |
Yikes, good catch @otan. |
Does this affect release-20.1? beac4a5 is about the temporary object cleaner which I think caused the delay, so I'm hopeful that fixes that, too. |
Yeah I will backport this along with the original fix.
…On Mon, 6 Apr 2020, 3:38 am Tobias Grieger, ***@***.***> wrote:
Does this affect release-20.1?
beac4a5
<beac4a5>
is about the temporary object cleaner which I think caused the delay, so
I'm hopeful that fixes that, too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#47063 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA32FQ7ZYPSVIQOCJOETPMLRLGWLZANCNFSM4MB7CWAQ>
.
|
In `beac4a53e0e2e2236eb5957f67abc1bf476ad1b6`, we introduced stopper.ShouldQuiesce() to the retry.Closer so that server shutdowns also shut down in-process retries to the temp schema cleaner. However, when stopper.ShouldQuiesce() is called, the error that gets wrapped in `errors.Wrap` is nil (as ctx.Err() is nil), and as such we return with no error set. This causes potentially bugs afterwards as users of the functions expected errors when this happens and not to continue silently. This PR bridges that gap by always wrapping an error around cases where WithMaxAttempt is aborted by a context attempt. Resolves cockroachdb#47057. Release note: None.
The original fix does (in the form of slow shutdowns), so when I backport it I will backport this PR along with it. |
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.
thanks!
bors r=knz |
@knz I encountered this pattern before - |
You may be thinking about |
Oh, TIL, thanks! |
Build succeeded |
Yeah, I'm a big fan of |
In
beac4a53e0e2e2236eb5957f67abc1bf476ad1b6
, we introducedstopper.ShouldQuiesce() to the retry.Closer so that server shutdowns
also shut down in-process retries to the temp schema cleaner.
However, when stopper.ShouldQuiesce() is called, the error that gets
wrapped in
errors.Wrap
is nil (as ctx.Err() is nil), and as such wereturn with no error set. This causes potentially bugs afterwards as
users of the functions expected errors when this happens and not to
continue silently.
This PR bridges that gap by always wrapping an error around cases where
WithMaxAttempt is aborted by a context attempt.
Resolves #47057.
Release note: None.