Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled VertxException when client closes http connection #22968

Closed
mathias-hess opened this issue Jan 18, 2022 · 1 comment
Closed

Unhandled VertxException when client closes http connection #22968

mathias-hess opened this issue Jan 18, 2022 · 1 comment
Labels
area/vertx env/windows Impacts Windows machines kind/bug Something isn't working

Comments

@mathias-hess
Copy link

mathias-hess commented Jan 18, 2022

Describe the bug

Whenever a http client closes the connection to a quarkus service, while quarkus writes the response object, an io.vertx.core.VertxException "Connection was closed" is thrown and not handled at all.

Expected behavior

I expect quarkus to handle the exception that occurs when a http client closes the http connection, while quarkus writes the response without logging it on error level. It should be normal behavior that a http client can close the connection at any time.

Actual behavior

An io.vertx.core.VertxException with the message Connection was closed is thrown and not handled. This causes the org.jboss.threads.LoggingUncaughtExceptionHandler to log the exception on error level.

How to Reproduce?

  • call a GET endpoint
  • close the connection on the client side while the the response data is written
  • get an error log from org.jboss.threads.LoggingUncaughtExceptionHandler

Output of uname -a or ver

Microsoft Windows [Version 10.0.19044.1415]

Output of java -version

openjdk version "11.0.7" 2020-04-14 LTS OpenJDK Runtime Environment Corretto-11.0.7.10.1 (build 11.0.7+10-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.7.10.1 (build 11.0.7+10-LTS, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.1

Build tool (ie. output of mvnw --version or gradlew --version)

Maven home: C:\Program Files (Dev)\apache-maven-3.8.3 Java version: 11.0.7, vendor: Amazon.com Inc., runtime: C:\Program Files\Amazon Corretto\jdk11.0.7_10 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

Example Stacktrace of the Unhandled Exception:

va.lang.RuntimeException: java.io.IOException: java.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:834)
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:82)
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

@mathias-hess mathias-hess added the kind/bug Something isn't working label Jan 18, 2022
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Jan 18, 2022
@mschorsch
Copy link
Contributor

mschorsch commented Jan 18, 2022

This bug has been fixed in Quarkus 2.5.2.Final (see #21762 and #21942).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants