vertx-sql-client
vertx-sql-client copied to clipboard
PostgreSQL: rollback hangs after server closes connection on which query was waiting for response
Version
4.3.3
Context
I use Materialize and use the PostgreSQL client to connect to it. When the server (or Docker running the server in a container) closes the connection while a query is executing that is waiting for a response from the server, the rollback of the transaction in the teardown hangs.
By setting an idle timeout in the connect options, the rollback will fail immediately.
Do you have a reproducer?
https://github.com/jstuyts/vertx-hanging-on-connection-close
Steps to reproduce
- Do NOT set an idle timeout in the connect options for the
PgPool. - Start a transaction.
- Execute a query that waits for a server response.
- Close the connection from the server side. (For example by stopping the server or the Docker container.)
- Roll back the transaction when the executing query is interrupted because of the connection loss. This rollback never completes.
Extra
The behavior has been seen on Windows 10 and CentOS Linux 7 machines. Runing OpenJDK 17 (Zulu on Windows and Temurin on Linux).