diff --git a/vertx-pg-client/src/main/java/io/vertx/pgclient/impl/codec/PgCodec.java b/vertx-pg-client/src/main/java/io/vertx/pgclient/impl/codec/PgCodec.java index 71d975050..ec58b604e 100644 --- a/vertx-pg-client/src/main/java/io/vertx/pgclient/impl/codec/PgCodec.java +++ b/vertx-pg-client/src/main/java/io/vertx/pgclient/impl/codec/PgCodec.java @@ -18,6 +18,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.CombinedChannelDuplexHandler; +import io.vertx.core.Completable; import io.vertx.sqlclient.ClosedConnectionException; import io.vertx.sqlclient.internal.command.CommandBase; import io.vertx.sqlclient.internal.command.CommandResponse; @@ -82,9 +83,10 @@ private void fail(Throwable cause) { } private void fail(PgCommandCodec codec, Throwable cause) { - CommandResponse failure = CommandResponse.failure(cause); - failure.cmd = (CommandBase) codec.cmd; - chctx.fireChannelRead(failure); + Completable handler = codec.cmd.handler; + if (handler != null) { + handler.complete(null, cause); + } } @Override diff --git a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/CloseConnectionTest.java b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/CloseConnectionTest.java index 95deda88e..b2cad3c16 100644 --- a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/CloseConnectionTest.java +++ b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/CloseConnectionTest.java @@ -76,7 +76,6 @@ private void testCloseConnection(TestContext ctx, Runnable test) { } @Test - @Ignore("Ignored due to https://github.com/eclipse-vertx/vertx-sql-client/issues/1506") public void testTransactionInProgressShouldFail(TestContext ctx) { ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost()); proxy.proxyHandler(conn -> {