Inline second statemachine into loop and us EC.Restore to reset context#23175
Merged
davidfowl merged 1 commit intodotnet:masterfrom Aug 17, 2020
Merged
Inline second statemachine into loop and us EC.Restore to reset context#23175davidfowl merged 1 commit intodotnet:masterfrom
davidfowl merged 1 commit intodotnet:masterfrom
Conversation
stephentoub
reviewed
Jun 19, 2020
| { | ||
| await FireOnCompleted(); | ||
| // Clear any AsyncLocals set during the request; back to a clean state ready for next request | ||
| ExecutionContext.Restore(cleanContext); |
Member
There was a problem hiding this comment.
What happens if an exception occurs prior to this? Is the thread polluted?
Member
Author
There was a problem hiding this comment.
Member
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Member
|
@aspnet-hello build |
Member
Author
|
Will fail the api is only internal currently as its not been approved/reviewed dotnet/runtime#38011 |
Member
Author
|
Change has been merged dotnet/runtime#40322; but don't know how fast it flows through? |
Member
Author
|
Not yet |
Member
Author
|
/azp run |
|
Commenter does not have sufficient privileges for PR 23175 in repo dotnet/aspnetcore |
Member
Author
|
Not yet |
Member
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Member
Author
|
Api was merged to runtime on 7 Jul, any idea how long its taking to flow through these days? |
Member
Author
|
🎉🥳 |
davidfowl
approved these changes
Aug 17, 2020
Member
|
Thanks @benaadams |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

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