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.
Follow-up to #789.
Cluster.ssl_session_cachelazily 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.