getsentry / getsentry/sentry-dotnet

.NET CancellationToken is cooperative - Check if it's cancelled.

Open
#693 3 comments 0 reactions 0 assignees View on GitHub
.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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.