Skip to content
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

Explicitly indicates the release of context resources in retry middleware #279

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

osamingo
Copy link

Resolve #203

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a test for this behaviour?

retry/retry.go Outdated Show resolved Hide resolved
@osamingo
Copy link
Author

@johanbrandhorst PTAL

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this a bit more, these manual cancel invocations are dangerous because if we add another error case we may forget to cancel. Could you refactor this function so that we can just defer cancel?

Also could you add some tests?

@osamingo
Copy link
Author

Could you refactor this function so that we can just defer cancel?
Also could you add some tests?

OK, I'll do it 👍

@yashrsharma44
Copy link
Collaborator

Hi @osamingo! Any progress? If not, I am happy to take over the changes requested 😄

@osamingo
Copy link
Author

osamingo commented Aug 3, 2021

@yashrsharma44 Thank you for mentioning me.
I'd be happy to take your word for it and have you take over, too!

@devnev devnev added the v1 label Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retry middleware ignores the context.CancelFunc returned by context.WithTimeout
4 participants