-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
x/sync: Use WithCancelCause for errgroup.WithContext #59355
Labels
Milestone
Comments
Change https://go.dev/cl/481255 mentions this issue: |
peczenyj
added a commit
to peczenyj/cache
that referenced
this issue
Aug 4, 2023
…59355 - use WithCancelCause to cancel context
peczenyj
added a commit
to peczenyj/cache
that referenced
this issue
Aug 4, 2023
…59355 - use WithCancelCause to cancel context
Seems to have landed without a proposal acceptance but too late to do anything about that now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
errgroup.WithContext
, the first non-nil error encountered will cancel the context and then be returned by the next call toWait
. This works well when you actually callWait
, but if that canceled context prevents you from callingWait
, you just get an unhelpfulcontext canceled
error.I believe the new
context.WithCancelCause
added in 1.20 would fix this, so I propose we use that instead of thiscontext.WithCancel
so we can propagate the error here, here, and here.The text was updated successfully, but these errors were encountered: