-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.9.0
-
Component/s: None
-
None
Came across this while implementing disablePersistentClient for PHPC-1645.
The internal HashTable for tracking persistent clients is initialized in GINIT; however, we free its clients and destroy the HashTable in MSHUTDOWN. This makes no difference for single-threaded PHP deployments (e.g. CLI, FPM), since GINIT and GSHUTDOWN are invoked once from MINIT and MSHUTDOWN, respectively; however, it could pose problems for threaded SAPIs (despite those being discouraged).
Since libmongoc clients should not be shared among threads, it does make sense to initialize the HashTable in GINIT and we should just ensure that the HashTable is destroyed during GSHUTDOWN to avoid potential leaks.
- is related to
-
PHPC-1645 Allow disabling of libmongoc client persistence
- Closed
- related to
-
PHPC-1997 Update calls to deprecated bson_atomic_int_add function
- Closed
-
PHPC-1366 Declare libbson vtable in MINIT instead of using a global
- Closed
-
PHPC-1367 Move libmongoc init/cleanup within scope of custom libbson vtable
- Closed
-
PHPC-1737 Use zend_hash_graceful_reverse_destroy to free persistent client HashTable
- Closed
- links to