-
So I'm using Resteasy Reactive and I was under the impression that quarkus would spawn a new thread when the current thread is blocked and this seems to be true when different routes are hit, but when hitting the same route, it keeps using the same thread. For example I have 2 routes:
If I hit /hello and then imediately hit /hello/hello2 I get an instant response from the 2nd route while the first route is still processing, which is great! However if I hit the first route twice ( /hello ) the second send request will not even start being processed until the first one finishes. This means that all it takes, is 1 slow request to /hello for this route to be blocked for all other clients. Any way to fix this? Here's a small reproducer: @Path("/hello")
public class GreetingResource {
static AtomicLong i = new AtomicLong(0);
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() throws InterruptedException {
Long c = i.incrementAndGet();
if (c == 1) {
System.out.println("SLOW OPERATION IN PROGRESS");
Thread.sleep(10000);
} else {
System.out.println("QUICK OPERATION");
}
return Thread.currentThread().getName();
}
} Just hit the /hello route twice, the second request should return instantly, but you will see the second request will be blocked by the first (Using quarkus 2.14.0.Final) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
/cc @geoand as it is about RESTEasy Reactive. |
Beta Was this translation helpful? Give feedback.
-
What you are describing is not the intended behavior and it is also not what I am seeing. |
Beta Was this translation helpful? Give feedback.
What you are describing is not the intended behavior and it is also not what I am seeing.
When I tried your example, everything worked as expected.