Skip to content

fix: non-volatile mutable global test flag can be stale across threads #1081

@Nam0101

Description

@Nam0101

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions