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

Fix race condition in TaskMonitoringHelper #8294

Merged
merged 2 commits into from
Oct 26, 2021
Merged

Fix race condition in TaskMonitoringHelper #8294

merged 2 commits into from
Oct 26, 2021

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Oct 26, 2021

Fixes #8163

TaskMonitoringHelper was using two seperate trackers for Idle and
FirstException and then calling WhenAny on both to see which state
happened first. This was racy as you could end up completing a task with
an exception but getting the idle tracker fire first, resulting in
TaskMonitoringHelper thinking no exception had happened.

I've combined the two trackers into TaskMonitoringHelper now. At each
task completion we check for exceptions and then idleness.

Fixes #8163

TaskMonitoringHelper was using two seperate trackers for Idle and
FirstException and then calling WhenAny on both to see which state
happened first. This was racy as you could end up completing a task with
an exception but getting the idle tracker fire first, resulting in
TaskMonitoringHelper thinking no exception had happened.

I've combined the two trackers into TaskMonitoringHelper now. At each
task completion we check for exceptions and then idleness.
@Frassle Frassle requested a review from a team October 26, 2021 15:53
Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for fixing.

@Frassle Frassle merged commit a199ba8 into master Oct 26, 2021
@pulumi-bot pulumi-bot deleted the fraser/issue8163 branch October 26, 2021 21:37
Frassle added a commit that referenced this pull request Oct 26, 2021
abhinav pushed a commit to pulumi/pulumi-dotnet that referenced this pull request Jan 11, 2023
* Fix race condition in TaskMonitoringHelper

Fixes pulumi/pulumi#8163

TaskMonitoringHelper was using two seperate trackers for Idle and
FirstException and then calling WhenAny on both to see which state
happened first. This was racy as you could end up completing a task with
an exception but getting the idle tracker fire first, resulting in
TaskMonitoringHelper thinking no exception had happened.

I've combined the two trackers into TaskMonitoringHelper now. At each
task completion we check for exceptions and then idleness.

* Add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception swallowing resulting in silent errors - dotnet
3 participants