Commit f2c2e7d
fix(otel): Avoid deadlock in SentryContextStorage.root() with virtual threads (#5234)
* fix(otel): Avoid deadlock in SentryContextStorage.root() with virtual threads
SentryContextStorage.root() called SentryContextWrapper.wrap() which
triggers scope.clone() and acquires locks. Under virtual threads,
ReentrantLock.unlock() can re-enter root() via OpenTelemetry executor
instrumentation on ForkJoinPool.execute(), causing a deadlock.
Return the default OTel root context without wrapping. Scopes are
resolved later via attach() or Sentry.getCurrentScopes().
Fixes GH-5226
Co-Authored-By: Claude <noreply@anthropic.com>
* changelog
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a7fc366 commit f2c2e7d
File tree
2 files changed
+10
-1
lines changed- sentry-opentelemetry/sentry-opentelemetry-bootstrap/src/main/java/io/sentry/opentelemetry
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
0 commit comments