From b9229a365040f7cd0009e8cfbf213de1a90abdd8 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Wed, 6 Oct 2021 16:16:10 +1100 Subject: [PATCH] Report throwable on write Note that we don't wait for the write operation for performance reasons to allow vert.x to buffer the response. The failure will be reported at some point before/during close. Fixes #20458 --- .../resteasy/runtime/standalone/VertxBlockingOutput.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extensions/resteasy-classic/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxBlockingOutput.java b/extensions/resteasy-classic/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxBlockingOutput.java index 998817a1ccb69..b8801e241e02e 100644 --- a/extensions/resteasy-classic/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxBlockingOutput.java +++ b/extensions/resteasy-classic/resteasy/runtime/src/main/java/io/quarkus/resteasy/runtime/standalone/VertxBlockingOutput.java @@ -69,8 +69,15 @@ Buffer createBuffer(ByteBuf data) { public void write(ByteBuf data, boolean last) throws IOException { if (last && data == null) { request.response().end(); + //if there is a problem we still try and end, but then throw to report to the caller + if (throwable != null) { + throw new IOException(throwable); + } return; } + if (throwable != null) { + throw new IOException(throwable); + } try { //do all this in the same lock synchronized (request.connection()) {