-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
quarkus-rest-client: java.io.IOException: Connection was closed invoking async endpoint #43792
Comments
/cc @cescoffier (rest-client), @geoand (rest-client) |
Thanks for reporting! Any chance you can put together a sample application which we can use to trivially see the problem in action? |
@geoand : Sure, here. To reproduce:
There are 3 unit tests, using So basically, I'm not sure that, given a REST endpoint like this:
its associated MP REST Client interface should be:
If it is, why do I get this exception ? If it isn't, how should then the interface be defined such that to match with the endpoint ? |
The reason that you are seeing this behavior in the tests is because when you do: CompletionStage<Void> currentDateAndTime = timeResourceClient.postCurrentDateAndTime()
... you are not actually waiting for the result, you are simply obtaining a "promise" that a result will at some point become available. This can be fixed very simply by adding: currentDateAndTime.toCompletableFuture().join(); |
Thanks |
👌 |
Describe the bug
In a Quarkus 3.15 web service I have the following REST endpoint:
The associated MP REST Client interface is:
And the client invocation:
Expected behavior
I expect that the code above works.
Actual behavior
Actually it doesn't and raises the following exception in the
exceptionally
section:I presume that this happens because, at the time that the new thread is created, the connection is already closed, or something similar. How could I fix that ?
Many thanks in advance.
How to Reproduce?
I don't have a reproducer but I could provide one, if required.
Output of
uname -a
orver
Linux nicolas-XPS-15-9570 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "21.0.3" 2024-04-16 LTS Java(TM) SE Runtime Environment (build 21.0.3+7-LTS-152) Java HotSpot(TM) 64-Bit Server VM (build 21.0.3+7-LTS-152, mixed mode, sharing)
Quarkus version or git rev
3.15.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /opt/apache-maven-3.9.5 Java version: 21.0.3, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-21-oracle-x64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.8.0-45-generic", arch: "amd64", family: "unix
Additional information
I've already experienced a similar issue (#42764), but it was in the context of using the JAX-RS client with Loom.
The text was updated successfully, but these errors were encountered: