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

[release/6.0] Fix: CTS.TryReset() concurrency issue #60182 #60323

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 13, 2021

Backport of #60224 to release/6.0
Fixes #60182

/cc @stephentoub @sakno

Customer Impact

The new CancellationTokenSource.TryReset method can, in rare race conditions, throw an ObjectDisposedException as part of normal usage. It occurs because the underlying TimerQueueTimer being used for coordination gets closed upon the timer callback firing, TryReset tries to Change that timer, and Change throws an ObjectDisposedException due to the timer having been closed. The simple short-term fix is to simply eat the benign exception in TryReset. We have various options for longer-term fixes in main.

Testing

CI

Risk

Minimal. The change simply adds a try/catch block to eat a specific exception type.

@ghost
Copy link

ghost commented Oct 13, 2021

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #60224 to release/6.0

/cc @stephentoub @sakno

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Threading

Milestone: -

@stephentoub stephentoub linked an issue Oct 13, 2021 that may be closed by this pull request
@stephentoub stephentoub merged commit 29dad02 into release/6.0 Oct 13, 2021
@stephentoub stephentoub deleted the backport/pr-60224-to-release/6.0 branch October 13, 2021 22:48
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTS.TryReset() concurrency issue
3 participants