-
Notifications
You must be signed in to change notification settings - Fork 409
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
Thread starvation due to sync over async code in IdentityModel.Tokens.Validators #2556
Labels
Bug
Product is not functioning as expected
P2
High, but not urgent. Needs to be addressed within the next couple of sprints
sync-over-async
Comments
jmprieur
added
Investigate
We are not quite sure what the issue is.
and removed
untriaged
needs attention
labels
Apr 11, 2024
victorm-hernandez
pushed a commit
that referenced
this issue
Apr 19, 2024
Exposed the ValidateAsync methods in the AadIssuerValidator class to allow for custom async validation of the issuer. Exposed the IssuerValidatorAsync delegate in the TokenValidationParameters so the custom async validation can be set. Updated the priority logic used to decide which custom validator has priority. Related issue: #2556
Based on the discussions, looks like there are 3 options:
Based on all the discussions, option 3 seems to be the better one. It's better to deliver a more well-planned out solution. |
pmaytak
added
Bug
Product is not functioning as expected
and removed
Investigate
We are not quite sure what the issue is.
labels
Apr 26, 2024
Moving to be handled part of: #2711 |
jennyf19
added
P2
High, but not urgent. Needs to be addressed within the next couple of sprints
and removed
P1
More important, prioritize highly
labels
Oct 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Product is not functioning as expected
P2
High, but not urgent. Needs to be addressed within the next couple of sprints
sync-over-async
Microsoft.Identity.Web Library
Microsoft.Identity.Web
Microsoft.Identity.Web version
2.17.2
Web app
Not Applicable
Web API
Protected web APIs (validating tokens)
Token cache serialization
Not Applicable
Description
We have been experiencing sporadic issues with our application deployed as an Azure App Service running on Linux (.net8).
We are using Microsoft.Identity.Web library and Microsoft Entra ID as our identity provider.
From time to time, we get an alert for failed health checks for one of the instances (minimum of 6 instances running). The instance seems to be unresponsive and for a period of time and the issue always resolves itself within a few minutes. There is no relevant info in the logs or in the Diagnose and solve problems section for the app service.
We can not identify any changes in request rate or resource utilization before the outage.
We have created a support case with Microsoft and have provided multiple memory dumps for analysis. The information we got from the support engineer is that the app service failure is caused by thread starvation due to sync over async code in IdentityModel.
Reproduction steps
The outage occurs sporadically and it is not possible to reproduce it on demand.
The problem seems to be related to load. We have several instances of the same application deployed in different Azure regions and the only instance where we have observed the problem is running under a relatively high load (~500-600 req/sec during peak time).
Error message
No response
Id Web logs
No response
Relevant code snippets
Regression
No response
Expected behavior
No application outages due to blocking calls :)
The text was updated successfully, but these errors were encountered: