You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parity: PostgreSQL reconnect-after-drop is Python-only — port to PHP, Ruby, Node (#236/#242) #244
PostgreSQL reconnect-after-drop is Python-only — bring PHP, Ruby, Node to parity
Python reconnects when the server drops a PostgreSQL connection (#236) and, after the
fix for #242, recovers even when the first reconnect attempt itself fails (a failover
before the new primary answers). PHP, Ruby and Node.js never re-establish a dropped
PostgreSQL link at all — once the server closes the connection (failover, idle-session
reap, pg_terminate_backend), every later statement fails until the process is restarted,
while a health check that does not touch the database keeps the process looking healthy.
This is the exact symptom #236 fixed in Python, still live in the other three.
Adapters to fix
PHP — Tina4/Database/PostgresAdapter.php (and PdoPostgresAdapter.php if active)
Ruby — lib/tina4/drivers/postgres_driver.rb
Node.js — packages/orm/src/adapters/postgres.ts
Acceptance criteria (mirror Python)
A statement that hits a server-dropped link reconnects from the original connect
arguments and retries once — but only when nothing uncommitted went down with it;
inside an explicit transaction the error surfaces and the next statement runs on a
new link.
A real-PostgreSQL regression test per framework (NO mocks): a real dropped backend,
a real failed reconnect, real recovery; mutation-proven (red on the old adapter).
The negative tests added along the way caught a real Ruby wedge (a failed ROLLBACK on a dropped link left the in-transaction flag set and wedged recovery) and exposed a Node over-reach (transaction control was wrongly reconnect-retried, breaking the connection-pool-isolation contract); both are fixed. PHP's ext-pgsql adapter was confirmed already-correct.
ONE follow-up stays open: PHP's PdoPostgresAdapter fallback (used only when ext-pgsql is absent) still owes the same port, tracked in #245.
Activity
tina4stack commentedon Oct 20, 2026
Done across all four frameworks' primary adapters, each verified against a real PostgreSQL (no mocks) and mutation-proven:
The negative tests added along the way caught a real Ruby wedge (a failed ROLLBACK on a dropped link left the in-transaction flag set and wedged recovery) and exposed a Node over-reach (transaction control was wrongly reconnect-retried, breaking the connection-pool-isolation contract); both are fixed. PHP's ext-pgsql adapter was confirmed already-correct.
ONE follow-up stays open: PHP's
PdoPostgresAdapterfallback (used only when ext-pgsql is absent) still owes the same port, tracked in #245.