Skip to content

Make lazy SSLSessionCache creation thread-safe #1018

Description

@dkropachev

Follow-up to #789.

Cluster.ssl_session_cache lazily creates its default cache without synchronization. Two concurrent first reads can construct and return distinct caches; one becomes orphaned and early connections can use different cache instances. A barrier around the constructor reproduces two creations and two distinct return values.

Guard initialization with the Cluster lock and double-check the field. Add a concurrent first-access regression test, including free-threaded Python coverage where available.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions