Skip to content
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

Make Dispose only Flush #599

Closed
bruno-garcia opened this issue Nov 21, 2020 · 2 comments · Fixed by #1354
Closed

Make Dispose only Flush #599

bruno-garcia opened this issue Nov 21, 2020 · 2 comments · Fixed by #1354
Assignees
Labels
ASP.NET Core Feature New feature or request
Projects

Comments

@bruno-garcia
Copy link
Member

The SDK is designed to run for the lifetime of the app. Dispose as in making it unusable is only a source of problems (ASP.NET Core creates multiple containers and we rely on a resolve of IHub to init the SDK, but when the (first) container is disposed, it disposes also that Hub so if an exception is generated in between that hub being disposed and the new container being created/hub taking over, those errors are lost.

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Nov 28, 2021

@SimonCropp is this something you can help us with?

there are multiple environments where this doesn't work well. One of those is using a new DI Scope to get the client, then rethrowing an exception which is captured after that scope is disposed.

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'SentryClient'.
   at Sentry.SentryClient.CaptureTransaction(Transaction transaction) in /_/src/Sentry/SentryClient.cs:line 109
   at Sentry.Internal.Hub.CaptureTransaction(Transaction transaction) in /_/src/Sentry/Internal/Hub.cs:line 341  
  Debug: Configuring the scope.
  Debug: Disposing scope.
  Error: Failure to capture transaction: e2fce1bb61ee4619

@SimonCropp
Copy link
Contributor

yep i can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASP.NET Core Feature New feature or request
Projects
No open projects
v3.x
Done
Development

Successfully merging a pull request may close this issue.

3 participants