dep-protobuf/python/google
Joshua Haberman 0ed798a0d2 Fixed race condition in free threaded builds related to the descriptor cache.
Prior to this CL, it was possible for the following sequence to occur:

|Thread 1|Thread 2|
|--------|--------|
|`obj = NewDescriptor(desc)`||
|`InsertCache(desc, obj)`||
|`Py_DECREF(obj)` (to 0)||
|`Dealloc(obj) {`||
||`LookupCache(desc) -> obj`|
||`Py_INCREF(obj)`|
|`  DeleteFromCache(obj)`||
|`}`||
||`Py_DECREF(obj)`|
||`Dealloc(obj)`|

This could lead to double-`Dealloc()` calls on a single object.  These calls could race, leading to TSAN failures.

We should look deeper into whether `GcTraverse()` and `GcClear()` still need critical sections.

PiperOrigin-RevId: 874084218
2026-02-23 08:30:44 -08:00
..
protobuf Fixed race condition in free threaded builds related to the descriptor cache. 2026-02-23 08:30:44 -08:00
__init__.py drop-deprecated-pkg-resources-declare (#22442) 2025-07-11 11:09:55 -07:00