fix: non-volatile mutable global test flag can be stale across threads
Open
- Dominant language
- Kotlin
- Stars
- 7.8k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
## Description
`isEndToEndTestRun` is a mutable global (`object` field) that can be changed at runtime, but it is not `@Volatile` or atomic. Reads/writes from different threads are a data race on JVM memory visibility, so one thread may not observe updates made by another. This can produce inconsistent thread-utils behavior during runtime toggles.
**Severity**: `medium`
**File**: `litho-rendercore-thread-utils/src/main/java/com/facebook/rendercore/thread/utils/RenderCoreThreadUtilsConfig.kt`
## Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Contributor guide
Assessment
This issue has not been assessed yet.