You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removes exception throwing during shutdown of dynamic instrumentation (#7375)
## Summary of changes
Removes exception throwing in "success" path, even when DI is disabled
## Reason for change
#7304 introduced a bunch of changes, but the use of
`CancellationTokenSource` resulted in exceptions being thrown in the
"happy" shutdown path, which can cause crashes in buggy versions of .NET
(i.e. all of them, currently)
## Implementation details
Replace usages of `TaskCompletionSource<bool>` with
`CancellationTokenSource`
## Test coverage
Covered by existing - checked the execution tests to make sure the
exception count has gone back own.
## Other details
Discovered some additional issues that need to be addressed I think.
Most importantly, `SafeDisposal` looks like a band-aid due to unclear
lifetime management. We should refactor the code to not require it i.e.
`Disposing` types should be safe and should not throw (regardless of
whether we catch the exception).
Additionally, this looks like it does quite a lot of work even when DI
is disabled. I would suggest we refactor it so that it doesn't do a
bunch of work in cases where it's never enabled.
0 commit comments