Skip to content

Synchronous REST Client calls fail with IllegalStateException: Response has been closed #48927

@gtroitsk

Description

@gtroitsk

Describe the bug

After fixes introduced in #48907 and #48807 synchronous REST client calls started failing with:
java.lang.IllegalStateException: Response has been closed
This occurs only in synchronous client calls that perform blocking operations. Asynchronous calls remain unaffected.

Expected behavior

Synchronous REST client calls should work as before, without throwing IllegalStateException, and tests should pass.

Actual behavior

Synchronous REST client calls fail with HTTP 500, due to IllegalStateException caused by the response being prematurely closed.

2025-07-15T04:07:49.6901640Z 04:07:49,631 INFO  ## Running test HttpVersionIT.testHttpAsyncResponseWithSingleClientOnGlobalClient()
2025-07-15T04:07:50.6972200Z 04:07:50,690 INFO  [app] 04:07:49,476 HTTP Request to /http2/https-synchronous-for-client-with-key failed, error id: b77ce16c-d153-4ae3-ac27-7ce10e50d7f8-1: java.lang.IllegalStateException: Response has been closed
2025-07-15T04:07:50.6973848Z 04:07:50,690 INFO  [app] 	at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.checkClosed(ResponseImpl.java:190)
2025-07-15T04:07:50.6974569Z 04:07:50,690 INFO  [app] 	at org.jboss.resteasy.reactive.common.jaxrs.ResponseImpl.getEntity(ResponseImpl.java:88)
2025-07-15T04:07:50.6975291Z 04:07:50,690 INFO  [app] 	at org.jboss.resteasy.reactive.server.handlers.ResponseHandler.handle(ResponseHandler.java:48)
2025-07-15T04:07:50.6976569Z 04:07:50,690 INFO  [app] 	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:145)
2025-07-15T04:07:50.6977905Z 04:07:50,690 INFO  [app] 	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
2025-07-15T04:07:50.6978703Z 04:07:50,690 INFO  [app] 	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:645)
2025-07-15T04:07:50.6979358Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
2025-07-15T04:07:50.6979998Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
2025-07-15T04:07:50.6980642Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
2025-07-15T04:07:50.6981298Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
2025-07-15T04:07:50.6981898Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
2025-07-15T04:07:50.6982518Z 04:07:50,691 INFO  [app] 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
2025-07-15T04:07:50.6983199Z 04:07:50,691 INFO  [app] 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2025-07-15T04:07:50.6983733Z 04:07:50,691 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:1583)

How to Reproduce?

  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=HttpVersionAlpnIT,HttpVersionAlpnWithConfigKeyIT,HttpVersionIT,HttpVersionWithConfigKeyIT -Dreruns=0 -fae

Output of uname -a or ver

Linux fedora 6.13.9-200.fc41.x86_64

Output of java -version

OpenJDK 64-Bit Server VM Temurin-21.0.7+6 (build 21.0.7+6-LTS, mixed mode, sharing)

Quarkus version or git rev

999-SNAPSHOT

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

Apache Maven 3.9.6 (Red Hat 3.9.6-7)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions