vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

PostgreSQL: rollback hangs after server closes connection on which query was waiting for response

Open jstuyts opened this issue 3 years ago • 0 comments

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

  1. Do NOT set an idle timeout in the connect options for the PgPool.
  2. Start a transaction.
  3. Execute a query that waits for a server response.
  4. Close the connection from the server side. (For example by stopping the server or the Docker container.)
  5. 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).

jstuyts avatar Aug 10 '22 09:08 jstuyts