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

[6.0] Check for time-sensitive work when worker thread starvation is ongoing #61931

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Nov 22, 2021

Customer Impact

When thread pool worker thread starvation is ongoing timer callbacks may not run. This can be problematic because timers intended to identify such issues and cause timeouts may not be triggered. This change does not fix the root of the problem, it only reverts the behavior to something similar to what was done in CoreCLR's native thread pool. It is and always has been possible for some timer callbacks to not run in reasonable time in such situations (such as when multiple timer callbacks are scheduled to run). This fix is only a minimal fix to revert the behavior in the portable thread pool to something similar to before, which would run one timer callback per batch during starvation.

Regression?

Yes, from 5.0

Testing

Verified behavior in the issue's test case. The behavior is reasonably similar to the previous behavior. No change in perf was noticed in highly bursty test cases that heavily exercise the modified path.

Risk

Low, the behavior is more similar to before and it's a small change in a path that is not too hot.

- Otherwise timer callbacks may not run when worker threads are continually starved
- The change is similar to what was done in CoreCLR's native thread pool
- Fixes dotnet#61804
@kouvel kouvel added this to the 6.0.x milestone Nov 22, 2021
@kouvel kouvel self-assigned this Nov 22, 2021
@ghost
Copy link

ghost commented Nov 22, 2021

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

Issue Details
Author: kouvel
Assignees: kouvel
Labels:

area-System.Threading

Milestone: 6.0.x

@kouvel kouvel changed the title Check for time-sensitive work when worker thread starvation is ongoing [6.0] Check for time-sensitive work when worker thread starvation is ongoing Nov 22, 2021
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We will consider this for 6.0.x

@safern safern merged commit de9467c into dotnet:release/6.0 Dec 15, 2021
@kouvel kouvel deleted the TpFix6 branch December 15, 2021 18:55
@ghost ghost locked as resolved and limited conversation to collaborators Jan 14, 2022
@ericstj ericstj modified the milestones: 6.0.x, 6.0.2 Feb 28, 2022
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.

5 participants