Skip to content

Commit 5ff8acc

Browse files
fix: Prevent deadlock in Hub.Dispose (#3539)
* no deadlock * Format code * sync * comment * . * Updated CHANGELOG.md --------- Co-authored-by: Sentry Github Bot <[email protected]>
1 parent 0c31b60 commit 5ff8acc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
## Fixes
6+
7+
- Resolved a potential deadlock during SDK shutdown ([#3539](https://github.com/getsentry/sentry-dotnet/pull/3539))
8+
39
## 4.10.1
410

511
### Fixes

src/Sentry/Internal/Hub.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,14 @@ public void Dispose()
613613
try
614614
{
615615
Metrics.FlushAsync().ContinueWith(_ =>
616-
CurrentClient.FlushAsync(_options.ShutdownTimeout).Wait()
616+
CurrentClient.FlushAsync(_options.ShutdownTimeout).ConfigureAwait(false).GetAwaiter().GetResult()
617617
).ConfigureAwait(false).GetAwaiter().GetResult();
618618
}
619619
catch (Exception e)
620620
{
621621
_options.LogError(e, "Failed to wait on disposing tasks to flush.");
622622
}
623-
//Dont dispose of ScopeManager since we want dangling transactions to still be able to access tags.
623+
//Don't dispose of ScopeManager since we want dangling transactions to still be able to access tags.
624624

625625
#if __IOS__
626626
// TODO

0 commit comments

Comments
 (0)