Description
If pgtle.clientauth_db_name names a database that does not exist, every login hangs forever. The clientauth background workers FATAL on startup, the postmaster respawns them once per second, and clientauth_hook waits on a shared-memory rendezvous no live worker ever completes. The GUC is PGC_POSTMASTER, so no one can log in to fix it.
Steps to reproduce
- Fresh cluster with
pg_tle in shared_preload_libraries.
- Set
pgtle.enable_clientauth = 'on' and pgtle.clientauth_db_name = 'ghost_db_does_not_exist'.
- Restart, then run
psql -c 'SELECT 1'.
Expected outcome
Connection succeeds (matching the existing "pg_tle not installed" fallback under on), or is cleanly rejected under require.
Actual outcome
psql hangs indefinitely. Killed by timeout 10 with exit 124 and no output.
Analysis
Have each worker bump a workers_ready counter after BackgroundWorkerInitializeConnection() succeeds. clientauth_hook waits briefly on it before enqueuing, and on timeout falls back to can_allow_without_executing / can_reject_without_executing.
Logs
FATAL: database "ghost_db_does_not_exist" does not exist
LOG: background worker "pg_tle_clientauth worker" (PID ...) exited with exit code 1
[repeats every second, forever]
Description
If
pgtle.clientauth_db_namenames a database that does not exist, every login hangs forever. The clientauth background workers FATAL on startup, the postmaster respawns them once per second, andclientauth_hookwaits on a shared-memory rendezvous no live worker ever completes. The GUC isPGC_POSTMASTER, so no one can log in to fix it.Steps to reproduce
pg_tleinshared_preload_libraries.pgtle.enable_clientauth = 'on'andpgtle.clientauth_db_name = 'ghost_db_does_not_exist'.psql -c 'SELECT 1'.Expected outcome
Connection succeeds (matching the existing "pg_tle not installed" fallback under
on), or is cleanly rejected underrequire.Actual outcome
psqlhangs indefinitely. Killed bytimeout 10with exit 124 and no output.Analysis
Have each worker bump a
workers_readycounter afterBackgroundWorkerInitializeConnection()succeeds.clientauth_hookwaits briefly on it before enqueuing, and on timeout falls back tocan_allow_without_executing/can_reject_without_executing.Logs