-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Inline second statemachine into loop and us EC.Restore to reset context #23175
Conversation
{ | ||
await FireOnCompleted(); | ||
// Clear any AsyncLocals set during the request; back to a clean state ready for next request | ||
ExecutionContext.Restore(cleanContext); |
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.
What happens if an exception occurs prior to this? Is the thread polluted?
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.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@aspnet-hello build |
Will fail the api is only internal currently as its not been approved/reviewed dotnet/runtime#38011 |
Change has been merged dotnet/runtime#40322; but don't know how fast it flows through? |
Not yet |
/azp run |
Commenter does not have sufficient privileges for PR 23175 in repo dotnet/aspnetcore |
Not yet |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Api was merged to runtime on 7 Jul, any idea how long its taking to flow through these days? |
🎉🥳 |
Thanks @benaadams |
Use EC.Restore to return to clean context rather than introducing a per request statemachine.
This allows use to use the connection request loop statemachine which is pre-allocated; and avoid one of the extra statemachines.
Requires dotnet/runtime#38011 "API Proposal: ExecutionContext.Restore(ExecutionContext? executionContext)"
/cc @stephentoub @halter73