Skip to content

Avoid UUID in default ExecutionId implementation #3435

@DanielThomas

Description

@DanielThomas

Describe the bug

UUID is backed by SecureRandom and because of the security sensitive nature of this randomness source, is backed by the blocking /dev/random. The default sun.security.provider.NativePRNG is also not thread safe, so the call to engineNextBytes occurs in a synchronized block.

That means in the cases where query concurrency exhausts the available entropy, queries will block on the randomness source, and each other due to the monitor.

To Reproduce

Seen in the real world, unclear on the conditions that lead to this being a problem on this host, but it runs upwards of 1k queries per second:

Screenshot 2024-02-05 at 5 19 01 pm

A counter, a timestamp mixed with some other source (such as the identityHashCode of the GraphQL instance), etc. may be a better choice to avoid SecureRandom.

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions