Skip to content

sentry/time: fix deadlock in GetTime by avoiding resetLocked under re… - #14172

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl966692033
Open

sentry/time: fix deadlock in GetTime by avoiding resetLocked under re…#14172
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl966692033

Conversation

@copybara-service

Copy link
Copy Markdown

sentry/time: fix deadlock in GetTime by avoiding resetLocked under re…

The GetTime function was calling resetLocked() while holding a read lock, but resetLocked expects a write lock since it modifies the clock state. This could cause a deadlock.

Fix by releasing the read lock before calling reset, which acquires the necessary write lock internally. Also removes the outdated TODO comment about sequence counters.

Fixes #181.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#14162 from Rajkaran-122:contrib/fix-sentry-time-read-lock 85cd528

The GetTime function was calling resetLocked() while holding a read lock, but resetLocked expects a write lock since it modifies the clock state. This could cause a deadlock.

Fix by releasing the read lock before calling reset, which acquires the necessary write lock internally. Also removes the outdated TODO comment about sequence counters.

Fixes #181.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#14162 from Rajkaran-122:contrib/fix-sentry-time-read-lock 85cd528
PiperOrigin-RevId: 966692033
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sentry/time: consider a sequence number of read locking

1 participant