getsentry / getsentry/sentry-dotnet
.NET CancellationToken is cooperative - Check if it's cancelled.
Open
.NET
Feature
- Dominant language
- C#
- Stars
- 770
- Forks
- 248
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 49
Description
While debugging https://github.com/getsentry/sentry-dotnet/issues/692 we noticed the cancellation token isn't checked anywhere. We only pass it along in hopes that whatever API takes it will throw if the token gets cancelled.
We need to check if the token is cancelled before doing expensive stuff. Specially on loops.
Mind that just returning might have different semantics than throwing `OperationCancelledException`.
Contributor guide
Assessment
This issue has not been assessed yet.