-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Exceptions on background thread are not handled and reported correctly #1772
Comments
@DrummerB thanks for raising this and providing the snippet. I can reproduce the issue locally and we're going to take a look! |
I was able to verify this issue. The stack trace for that being logged indicates its caused by the
After that dispose is called, no more errors are captured during the same runtime (regardless of the thread). I didn't get the exception user mentions above, but that may be irrelevant - the main problem here is the |
This looks like sentry-dotnet bug to me, adding a flag. |
This makes sense in .NET in general since once we return the process crashes, so we flush in there. I believe Hub.Dispose was changed to only flush. If not, maybe that's the fix |
from the PoV of Unity, this is a p0 |
Checking if that's the case - this indicates it's not - https://stackoverflow.com/a/6465586/2386130 |
In the end, whether it crashes or not on the given platform doesn't matter. If we think back about what this code is trying to achieve: sentry-dotnet/src/Sentry/Integrations/AppDomainUnhandledExceptionIntegration.cs Lines 28 to 41 in ab29664
the point isn't disposing of the hub (thus effectively disabling it, because of line 392): sentry-dotnet/src/Sentry/Internal/Hub.cs Lines 387 to 399 in ab29664
My suggestion is to change the code so that it doesn't dispose of the Hub, but instead flushes events. There are a few non-breaking changes we can do to achieve this. E. g. we can add an internal method to the Hub: |
We don't support .NET Framework 1.0 through 2.0. In the versions we support, unless you set
Agreed. See: #599 |
So, if in the |
Thanks for the fix @mattjohnsonpint |
Great, thanks for the fix! |
Environment
How do you use Sentry?
sentry.io
Which version of the SDK?
0.20.1
How did you install the package?
UPM, git-url
Which version of Unity?
2021.3.6f1 LTS
Is this happening in Unity (editor) or on a player like Android, iOS, Windows?
Reproduced in Windows Editor and Windows Player
Steps to Reproduce
Expected Result
Exceptions are reported as events to sentry.io
Actual Result
Only the first exception is handled and reported correctly.
Something seems to go wrong within the SDK, because after the first exception, subsequent exceptions do not result in any debug logs from Sentry, except a single "Sentry: (Info) Disposing the Hub", which is directly followed by:
Code
Any logs or screenshots
editor-log.txt
The text was updated successfully, but these errors were encountered: