-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱Use context.WithTimeoutCause and context.WithCancelCause for better readability #11705
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
On looking into the occurrences of |
/cc @sbueringer |
Definitely fine to not change anything in test files |
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.
Thx for opening this PR. I think it's better to express "why the timeout/context expired" vs expressiong what we were doing when it expired. The latter is usually handled when we wrap the error
Not sure if you pushed your latest commit :) I didn't see any changes to context.Cancel in non-test files. (there are also a few more cases of context.WithTimeout in non-test files, but you might have been looking for initial feedback before addressing these :)) |
That's right, I will address the review the comments and cover the remaining occurrences in non test files as well. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
This PR replaces
context.WithTimeoutCause
andcontext.WithCancelCause
instead ofcontext.Timeout
andcontext.WithCancel
for better readability of issues when the standardcontext deadline exceeded
error is emitted.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #11280