dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

[release/9.0-staging] Transfer ThreadPool local queue to high-pri queue on Task blocking #109989

Open github-actions[bot] opened 2 days ago

github-actions[bot] commented 2 days ago

Backport of #109841 to release/9.0-staging

/cc @stephentoub

Customer Impact

This is an experimental fix related https://github.com/dotnet/runtime/pull/103984. Some 1p services that use a lot of sync-over-async are experiencing stalls due to some priority inversion issues in work items that get queued to the thread pool. In some situations, the services stall for a long time until a large number of worker threads are injected, which can take a long time. This change would help the app continue to make progress. This change (in addition addition to some app-level throttling to stop new items from being added to the request queue) should help with unblocking.

Regression

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

n/a. This is experimental to validate in production with the config set.

Risk

Low, the feature is behind a config flag

dotnet-policy-service[bot] commented 2 days ago

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

stephentoub commented 2 days ago

cc: @mangod9