Inject a delay in the initialisation of a Postgres Backend (we injected it in InitPostgres() with post_auth_delay), such that the driver login timeout fires, but there may be other ways to do so depending on your Postgres set up
Observe that the postgres backend stays connected, and is unable to detect that the other end has exited (waiting forever in the ServerLoop, never receiving EOF on the unix domain socket as I would expect)
Observations:
If this program exits, the socket is closed properly - the leak only exists for long-running clients that timeout
This does appear to reproduce for TCP sockets as well
Hi there 😄 We have been noticing a leaked connection under certain circumstances when connecting to a PG database with this driver.
Here is the simple program I am connecting with:
To repro the issue:
InitPostgres()
withpost_auth_delay
), such that the driver login timeout fires, but there may be other ways to do so depending on your Postgres set upObservations: