quarkus: IllegalStateException, reactive jaxrs - Don't block when returning void
Describe the bug
Similar case as https://github.com/quarkusio/quarkus/issues/22251 but for cases when void is returned.
Works fine with Quarkus 2.5.4.Final, Fails on Quarkus main
2021-12-21 08:36:35,548 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-22) HTTP Request to /value failed, error id: 611ecf39-7ad2-487c-9410-d942dc50f760-1: java.lang.IllegalStateException: The current thread cannot be blocked: vert.x-eventloop-thread-22
at io.smallrye.mutiny.operators.uni.UniBlockingAwait.await(UniBlockingAwait.java:30)
at io.smallrye.mutiny.groups.UniAwait.atMost(UniAwait.java:62)
at io.smallrye.mutiny.groups.UniAwait.indefinitely(UniAwait.java:43)
at io.quarkus.cache.runtime.CacheInvalidateInterceptor.intercept(CacheInvalidateInterceptor.java:39)
at io.quarkus.cache.runtime.CacheInvalidateInterceptor_Bean.intercept(Unknown Source)
at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
at org.acme.ReactiveResource_Subclass.getValue(Unknown Source)
at org.acme.ReactiveResource$quarkusrestinvoker$getValue_383be323698d81f3c8faf6d402c8e221fd043820.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:7)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
at org.jboss.resteasy.reactive.server.handlers.RestInitialHandler.beginProcessing(RestInitialHandler.java:49)
at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:17)
at org.jboss.resteasy.reactive.server.vertx.ResteasyReactiveVertxHandler.handle(ResteasyReactiveVertxHandler.java:7)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1193)
...
Expected behavior
Pass the test / return HTTP 204 aka NO_CONTENT
Actual behavior
Test fails with IllegalStateException, log says The current thread cannot be blocked: vert.x-eventloop-thread-22
How to Reproduce?
use reproducer from https://github.com/quarkusio/quarkus/issues/22251 with these adjustments:
@NonBlocking
@Path("/value")
public class ReactiveResource {
public static final String CACHE_NAME = "mycache";
@GET
@CacheInvalidate(cacheName = CACHE_NAME)
public void getValue() {
}
}
Change .statusCode(HttpStatus.SC_OK)
to .statusCode(HttpStatus.SC_NO_CONTENT)
in ReactiveResourceTest
Alternative way:
- Use https://github.com/rsvoboda/quarkus-test-suite/tree/revert.50d90aa
- run
mvn clean verify -pl cache/caffeine
Output of uname -a
or ver
macOS Monterey
Output of java -version
Java 17
GraalVM version (if different from Java)
No response
Quarkus version or git rev
main
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (21 by maintainers)
Done 😃
I propose sending an email to
quarkus-dev
to get opinions on this