diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb9c21d4b..84ff55a9db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/Sentry/Internal/Hub.cs b/src/Sentry/Internal/Hub.cs index 2a40489c33..151150514a 100644 --- a/src/Sentry/Internal/Hub.cs +++ b/src/Sentry/Internal/Hub.cs @@ -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