Skip to content

ZOOKEEPER-5052: Fix stale thread write of primitive in JvmPauseMonitor#2397

Open
PDavid wants to merge 1 commit into
apache:masterfrom
PDavid:ZOOKEEPER-5052-JvmPauseMonitor
Open

ZOOKEEPER-5052: Fix stale thread write of primitive in JvmPauseMonitor#2397
PDavid wants to merge 1 commit into
apache:masterfrom
PDavid:ZOOKEEPER-5052-JvmPauseMonitor

Conversation

@PDavid
Copy link
Copy Markdown
Contributor

@PDavid PDavid commented May 27, 2026

Change the three counter fields to volatile to ensure cross-thread visibility when the getters are called from threads other than the monitor thread.

This prevents the JVM caching the stale 0 value. Under CI load or with aggressive JIT optimizations, this manifests as an intermittent 5-second timeout.

Change the three counter fields to volatile to ensure cross-thread visibility when the getters are called from threads other than the monitor thread.

This prevents the JVM caching the stale 0 value. Under CI load or with aggressive JIT optimizations, this manifests as an intermittent 5-second timeout.
Copy link
Copy Markdown

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Looks like a simple issue; thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants