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

Returing a file from Quarkus REST endpoint with Uni leads to Vert.x error now that Vert.x Pump was replaced #45627

Closed
michalvavrik opened this issue Jan 16, 2025 · 5 comments · Fixed by #45630
Labels
area/rest area/vertx kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Member

Describe the bug

I have a REST endpoint like this:

@GET
    @Path("/download")
    public Uni<File> download() {
        return Uni.createFrom().item(file);
    }

After #45538 my request to this endpoint hangs.

Expected behavior

Works.

Actual behavior

Request hangs and following error is logged:

20:01:42,622 INFO  [app] 20:01:42,281 Uncaught exception received by Vert.x: java.lang.IllegalStateException: File handle is closed
20:01:42,623 INFO  [app] 	at io.vertx.core.file.impl.AsyncFileImpl.checkClosed(AsyncFileImpl.java:550)
20:01:42,624 INFO  [app] 	at io.vertx.core.file.impl.AsyncFileImpl.doFlush(AsyncFileImpl.java:448)
20:01:42,625 INFO  [app] 	at io.vertx.core.file.impl.AsyncFileImpl.flush(AsyncFileImpl.java:335)
20:01:42,625 INFO  [app] 	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$3$2$1$1.handle(ClientSendRequestHandler.java:314)
20:01:42,626 INFO  [app] 	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$3$2$1$1.handle(ClientSendRequestHandler.java:311)
20:01:42,626 INFO  [app] 	at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176)
20:01:42,627 INFO  [app] 	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60)
20:01:42,627 INFO  [app] 	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
20:01:42,628 INFO  [app] 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
20:01:42,628 INFO  [app] 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
20:01:42,629 INFO  [app] 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
20:01:42,629 INFO  [app] 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
20:01:42,630 INFO  [app] 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
20:01:42,630 INFO  [app] 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
20:01:42,631 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:1583)

How to Reproduce?

Steps to reproduce the behavior:

  1. git clone git@github.com:quarkus-qe/quarkus-test-suite.git
  2. cd quarkus-test-suite/http/rest-client-reactive
  3. mvn clean verify -Dit.test=LargeFileHandlingIT

Output of uname -a or ver

Fedora 41

Output of java -version

Temurin 21 and 17

Quarkus version or git rev

999-SNAPSHOT

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

No response

Additional information

No response

@michalvavrik michalvavrik added area/rest kind/bug Something isn't working labels Jan 16, 2025
@michalvavrik
Copy link
Member Author

cc @geoand

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

Thanks, I'll have a look

geoand added a commit to geoand/quarkus that referenced this issue Jan 16, 2025
@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

#45630 fixes the issue

@geoand geoand closed this as completed in 30ee339 Jan 16, 2025
geoand added a commit that referenced this issue Jan 16, 2025
Fix file handling in REST Client
@quarkus-bot quarkus-bot bot added this to the 3.19 - main milestone Jan 16, 2025
@michalvavrik
Copy link
Member Author

#45630 fixes the issue

thanks for quick fix

@geoand
Copy link
Contributor

geoand commented Jan 16, 2025

Thanks for spotting the issue!

@gsmet gsmet modified the milestones: 3.19 - main, 3.18.0 Jan 21, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 21, 2025
Fixes: quarkusio#45627
(cherry picked from commit 30ee339)
carlesarnal pushed a commit to carlesarnal/quarkus that referenced this issue Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest area/vertx kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants