-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[7.0] Check for pending IO in the portable thread pool's worker threads #82246
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tagging subscribers to this area: @mangod9 Issue Details
Port of fix for #82207
|
mangod9
approved these changes
Mar 1, 2023
kouvel
added
Servicing-consider
Issue for next servicing release review
and removed
Servicing-consider
Issue for next servicing release review
labels
Mar 1, 2023
jeffschwMSFT
approved these changes
Mar 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved. we will take for consideration in 7.0.x
rbhanda
added
Servicing-approved
Approved for servicing release
and removed
Servicing-consider
Issue for next servicing release review
labels
Mar 7, 2023
- Port of dotnet#82245 - When Resource Monitor is attached, some async IO operations are bound to the thread that issued it even though the IO handle is bound to an IOCP. If the thread exits, the async IO operation is aborted. This can lead to hangs or unexpected exceptions. - Added a check that was missing in the portable thread pool implementation to prevent exiting a worker thread when it has pending IO Port of fix for dotnet#82207
Rebased |
This was referenced Mar 8, 2023
The CI failures look unrelated to this change. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Port of fix for #82207
Customer Impact
When Resource Monitor is attached to a .NET process, some async IO operations are aborted when thread pool worker threads exit. This leads to a hang in ASP.NET apps, where it's unable to accept new connections. The issue may also manifest as an unexpected exception. Customers have reported seeing regular instances of this issue in several apps, and the apps have to be restarted. The issue may also occur with other perf monitor tools attached. A workaround is to configure the runtime to not use the portable thread pool.
Regression?
Yes, from 5.0 and 6.0. In 6.0 the portable thread pool is used by default for worker threads. In 7.0 the portable thread pool is used by default for IO on Windows.
Testing
Verified with the repro that the behavior is the same as before.
Risk
Low. The check for pending IO already existed in the native thread pool implementation and this change adds the check to the portable thread pool implementation.