Skip to content

Commit

Permalink
fix: Prevent deadlock in Hub.Dispose (#3539)
Browse files Browse the repository at this point in the history
* no deadlock

* Format code

* sync

* comment

* .

* Updated CHANGELOG.md

---------

Co-authored-by: Sentry Github Bot <[email protected]>
  • Loading branch information
bitsandfoxes and getsentry-bot authored Aug 19, 2024
1 parent 0c31b60 commit 5ff8acc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

## Fixes

- Resolved a potential deadlock during SDK shutdown ([#3539](https://github.com/getsentry/sentry-dotnet/pull/3539))

## 4.10.1

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,14 @@ public void Dispose()
try
{
Metrics.FlushAsync().ContinueWith(_ =>
CurrentClient.FlushAsync(_options.ShutdownTimeout).Wait()
CurrentClient.FlushAsync(_options.ShutdownTimeout).ConfigureAwait(false).GetAwaiter().GetResult()
).ConfigureAwait(false).GetAwaiter().GetResult();
}
catch (Exception e)
{
_options.LogError(e, "Failed to wait on disposing tasks to flush.");
}
//Dont dispose of ScopeManager since we want dangling transactions to still be able to access tags.
//Don't dispose of ScopeManager since we want dangling transactions to still be able to access tags.

#if __IOS__
// TODO
Expand Down

0 comments on commit 5ff8acc

Please sign in to comment.