Resteasy "connection was closed" error after upgrading to 2.4.x
See original GitHub issueDescribe the bug
After bumping the Quarkus version to 2.4.x (tested 2.4.0.Final, 2.4.1.Final, and 2.4.2.Final) in Keycloak, the following error is happening every time you reload a page multiple times during a short period (e.g.: holding F5 when at the browser):
2021-11-28 17:51:03,913 ERROR [org.jbo.thr.errors] (executor-thread-4) Thread Thread[executor-thread-4,5,main] threw an uncaught exception: java.lang.RuntimeException: java.io.IOException: j
ava.io.IOException: io.vertx.core.VertxException: Connection was closed
at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse.vertxFlush(VertxHttpRequest.java:396)
at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse$1.run(VertxHttpRequest.java:326)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: java.io.IOException: io.vertx.core.VertxException: Connection was closed
at io.quarkus.resteasy.runtime.standalone.VertxOutputStream.close(VertxOutputStream.java:124)
at io.quarkus.resteasy.runtime.standalone.VertxHttpResponse.finish(VertxHttpResponse.java:145)
at io.quarkus.resteasy.runtime.standalone.VertxHttpRequest$VertxExecutionContext$VertxHttpAsyncResponse.vertxFlush(VertxHttpRequest.java:394)
... 8 more
Caused by: java.io.IOException: io.vertx.core.VertxException: Connection was closed
at io.quarkus.resteasy.runtime.standalone.VertxBlockingOutput.write(VertxBlockingOutput.java:79)
at io.quarkus.resteasy.runtime.standalone.VertxHttpResponse.writeBlocking(VertxHttpResponse.java:172)
at io.quarkus.resteasy.runtime.standalone.VertxOutputStream.close(VertxOutputStream.java:122)
... 10 more
Caused by: io.vertx.core.VertxException: Connection was closed
The error does not happen if we downgrade to version 2.3.1.
Expected behavior
No errors in logs if loading a page multiple times.
Actual behavior
Errors are shown in logs as per description.
How to Reproduce?
I’m did not work yet a reproducer but the error is very easy to reproduce by following these steps:
- Build Keycloak.X Distribution with pom.xml in quarkus package set to 2.5.0.Final (and postgres to 42.3.1), use e.g. mvn clean install -DskipTests -Pdistribution in root directory (or see readme here: https://github.com/keycloak/keycloak/tree/main/quarkus ).
- unpack zip from distribution/server-x-dist/target
- cd /bin
- run ./kc.sh start-dev
- Using a browser, reload the page multiple times during a very short period of time
Output of uname -a
or ver
Linux fedora 5.14.18-200.fc34.x86_64 #1 SMP Fri Nov 12 16:48:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “11.0.13” 2021-10-19 OpenJDK Runtime Environment 18.9 (build 11.0.13+8) OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.4.2.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (12 by maintainers)
@geoand Works with
2.5.0.Final
and also with the latest999-SNAPSHOT
. I’m still running tests though but I could not reproduce the error so far using those versions.I’m afraid we are going to need to wait for
2.5.1
before we release KC v16.Thanks.
Thanks for the reproducer.
I opened https://github.com/quarkusio/quarkus/pull/21942 to handle it