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.
Description
isEndToEndTestRunis a mutable global (objectfield) that can be changed at runtime, but it is not@Volatileor 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:
mediumFile:
litho-rendercore-thread-utils/src/main/java/com/facebook/rendercore/thread/utils/RenderCoreThreadUtilsConfig.ktExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.