Skip to content

Fix threading issues around idleTimer

7a0395a
Select commit
Loading
Failed to load commit list.
Open

feat: Auto-create traces for MAUI navigation events #5111

Fix threading issues around idleTimer
7a0395a
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Apr 9, 2026 in 14m 31s

3 issues

Medium

ReaderWriterLockSlim _finishLock is never disposed - `src/Sentry/TransactionTracer.cs:21`

The _finishLock field of type ReaderWriterLockSlim is created but never disposed. ReaderWriterLockSlim implements IDisposable and holds native resources that should be released. The Dispose() method only calls Finish() which disposes _idleTimer but not _finishLock, leading to potential resource leaks when many transactions are created.

Low

ReaderWriterLockSlim _finishLock is never disposed - `src/Sentry/TransactionTracer.cs:21`

The ReaderWriterLockSlim introduced in line 21 holds native kernel synchronization objects (especially on Windows) but is never disposed. While the class comment says Disposing is not required, the Dispose() method only calls Finish() which disposes _idleTimer but not _finishLock. In high-throughput scenarios with many short-lived transactions, this could lead to gradual handle exhaustion.

Debug log message references transaction SpanId instead of child span SpanId - `src/Sentry/TransactionTracer.cs:340`

When discarding a child span due to the span limit, the debug log message at line 340 logs SpanId (the transaction's SpanId) instead of span.SpanId (the child span being discarded). This causes misleading debug output that references the wrong span, making troubleshooting more difficult.

Also found at:

  • src/Sentry/TransactionTracer.cs:349
4 skills analyzed
Skill Findings Duration Cost
code-review 1 11m 6s $7.79
find-bugs 2 6m 26s $13.88
gha-security-review 0 12m 13s $1.92
security-review 0 14m 24s $3.30

Duration: 44m 9s · Tokens: 16.4M in / 174.9k out · Cost: $26.91 (+extraction: $0.01, +dedup: $0.01, +merge: $0.00, +fix_gate: $0.00)