-
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
Does EDI message provide benefit? "End of stack trace from previous location..." #9517
Comments
I've debugged a ton of async code and never found this to be useful...we remove it in presentation already. I really am very curious to hear actual use cases for it, but support removing it for the default experience. |
I wasn't around for v1, but there was a benefit as a consumer of remoting to a separation between where an exception was thrown on a server, and then thrown on the client. These days, however, where all I'm doing is looking at is async stack traces, these markers are meaningless and noise. |
Should outputting boundaries then be a settable flag that defaults to e.g. I'm not sure; for example if WCF, forwards server errors into client stack; but if it did the flag could be set on the re-hydration point rather than just use of EDI as its become much more widespread. |
Agreed. AFAIK when we designed EDI we just plugged into the existing remoting infrastructure; the markers came with it and weren’t explicitly designed (but I could be wrong). I agree with Nick and David — they seem mostly noise to me. |
I agree that these boundaries are noise when they are generated in C# language support library like the AsyncMethodBuilder. It makes sense to remove them for these cases. I think the boundaries are still valuable when up stack libraries store and rethrow exceptions manually from different places. |
Why? Navigating the trace will reveal what’s going on. |
I except that many people will get quite confused when they are going to see:
in the stacktrace and no obvious way how MethodB could have ever called MethodA in the source. |
But any of these methods will have an EDI.Throw(), no? IOW these will be from advanced users. |
Looking at the code, its not straight forward to either/or as it is based on the values in e.g. its fairly easy to completely switch it off; but doesn't seem as easy to partially switch it off (would need C++ changes) |
Added PR for completely removing it (easier option) dotnet/coreclr#15781 Someone else would need to look at changing the unmanaged code if partial removal is preferred? |
As an aside |
The marker was explicitly designed and added as part of the EDI. It did not exist before EDI.
Yes, there will be
If you just completely switch it off, I think it will leave questionable behaviors behind. For example, the stacktrace in this example is going to have method
|
One option is to consider reducing the noise:
Though, maybe we can make changes to ExceptionDispatchInfo itself that we can opt only particular scenarios into skipping the marker (such as async infrastructure). |
Hmm... ok. The StackTrace prior to dotnet/coreclr#14652 would have been
So could conditionally if the last item is either as StateMachine as per dotnet/coreclr#14655; or in the |
Switched off the boundary just for async and mscorlib dotnet/coreclr#15781 |
Using async (and
ExceptionDispatchInfo
in other areas) ends up outputting lots of lines that are:--- End of stack trace from previous location where exception was thrown ---
I do get that its technically correct as it is where the exception was saved and restored, so a stitch point; just not sure what benefit it imparts to a user looking at the stack trace.
Example 1
I'm not sure the benefit this has over: (resolving async aside dotnet/coreclr#14655)
Example 2
For async the traces could be prefix if it is an async method (as its known while resolving the async method) for clues:
Example 3
And with Resolving async dotnet/coreclr#14655 that could become
Example 4
If it only output indicating when an async method was actually suspended and resumed it would be more of an interesting marker, but that's not what it currently does.
Does it currently provide benefits? Thoughts?
Aside: Xunit removes its own stacks but leaves in the EDI lines so you end up with
/cc @stephentoub @tmat @noahfalk @aelij @jkotas @danmosemsft
The text was updated successfully, but these errors were encountered: