Context / Problem
If fdb_setup_network() succeeds but pthread_create (or the dlopen/dlsym steps) subsequently throws, networkStarted stays false even though the network was already set up, and the shutdown handler is never registered:
src/NativeClient.php:210-248
A later ensureNetwork() then calls fdb_setup_network() a second time (error: network already set up), and the network thread may never be joined at shutdown — a wedged, unrecoverable state.
Affected files / locations
- src/NativeClient.php:210-266
Proposed approach
Track the fact that fdb_setup_network() has already succeeded separately from full readiness, and on partial-initialization failure either clean up consistently or record state so the object is not left in a half-initialized condition that breaks retry and shutdown.
Acceptance Criteria
Severity
Low
Context / Problem
If
fdb_setup_network()succeeds butpthread_create(or the dlopen/dlsym steps) subsequently throws,networkStartedstays false even though the network was already set up, and the shutdown handler is never registered:A later
ensureNetwork()then callsfdb_setup_network()a second time (error: network already set up), and the network thread may never be joined at shutdown — a wedged, unrecoverable state.Affected files / locations
Proposed approach
Track the fact that
fdb_setup_network()has already succeeded separately from full readiness, and on partial-initialization failure either clean up consistently or record state so the object is not left in a half-initialized condition that breaks retry and shutdown.Acceptance Criteria
Severity
Low