-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Capture Edi at Abort not throw #11875
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I approved it since it feels more standard/correct, but is there an actual functional impact to this?
For example, if the same exception instance gets rethrown somewhere else after we "capture" it here, will it save us from those super-long stack traces being built up from the multiple throwers of the same exception?
Edit: I just saw "So it doesn't add to the exception on every throw" in the PR description. I think I get it now. Was it the multiple calls to ExceptionDispatchInfo.Capture() itself that created the long stack traces, not the throwing of the exception multiple times?
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.
The exception is mutable; so each
.Capture(error)
adds another stack to the original exception; combined with the.Capture(error).Throw()
it means each timeValidateState
is called and throws it will add anew stack to the exception so each Throw will get a longer and longer stack trace (if it happens multiple times with the same exception).Changing this to only capture once; means even if it throws multiple times the stack won't grow and grow (concurrent throws aside).
This would do that; however... I don't see
HttpRequestPipeReader
in the stacks, so I'm not sure its the cause?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.
Putting it another way, this is a definite issue with what its doing here and a fix
Not sure about the other though; perhaps if the same exception is getting Edi captured in two or more places #11827 then the stack could get wacky?
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.
e.g.