quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.57k stars 2.63k forks source link

quarkus-resteasy-reactive-jackson extension raises timeout exception #39627

Closed nicolasduminil closed 6 months ago

nicolasduminil commented 6 months ago

Describe the bug

Using Quarkus 3.8.3 with the quarkus-resteasy-reactive-jackson extension to expose a REST API. It randomly raises the following timeout exception:

2024-03-21 17:42:09,862 ERROR [io.qua.lan.run.ais.AiServiceMethodImplementationSupport] (executor-thread-1)  Execution of fr.simplex_software.llm.haiku.HaikuService#answerMyQuestion failed: jakarta.ws.rs.ProcessingException: The timeout period of 10000ms has been exceeded while executing POST /api/generate for server null
    at org.jboss.resteasy.reactive.client.impl.InvocationBuilderImpl.unwrap(InvocationBuilderImpl.java:223)
    at org.jboss.resteasy.reactive.client.impl.InvocationBuilderImpl.method(InvocationBuilderImpl.java:339)
    at io.quarkiverse.langchain4j.ollama.OllamaRestApi$$QuarkusRestClientInterface.generate(Unknown Source)
    at io.quarkiverse.langchain4j.ollama.OllamaClient.completion(OllamaClient.java:35)
    at io.quarkiverse.langchain4j.ollama.OllamaChatLanguageModel.generate(OllamaChatLanguageModel.java:40)
    at  dev.langchain4j.model.chat.ChatLanguageModel_XNMsOaekknG7BdNZ5YSUkjh1SqE_Synthetic_ClientProxy.generate(Unknown Source)
    at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.doImplement(AiServiceMethodImplementationSupport.java:161)
    at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.implement(AiServiceMethodImplementationSupport.java:78)
    at fr.simplex_software.llm.haiku.HaikuService$$QuarkusImpl.answerMyQuestion(Unknown Source)
    at fr.simplex_software.llm.haiku.HaikuService$$QuarkusImpl_ClientProxy.answerMyQuestion(Unknown Source)
    at fr.simplex_software.llm.haiku.HaikuResource.answerAnyQuestion(HaikuResource.java:26)
    at fr.simplex_software.llm.haiku.HaikuResource$quarkusrestinvoker$answerAnyQuestion_9d73500961dba1becbad6cc8785d8b4564826544.invoke(Unknown Source)
    at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
    at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
    at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
    at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
    at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
    at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:840)
 Caused by: io.vertx.core.impl.NoStackTraceTimeoutException: The timeout period of 10000ms has been exceeded while executing POST /api/generate for server null

How could I increase the timeout ? I've tried to annotate the associated endpoint with @Timeout(25000) but it still timeouts after 10000 ms.

Expected behavior

I expect that the POST request doesn't timeout after 10000 ms since it's set at 25000 ms.

Actual behavior

The POST requests timeouts after 10000 ms randomly,especially for the 1st execution.

How to Reproduce?

Don't have a reproducer.

Output of uname -a or ver

Linux nicolas-XPS-15-9570 5.15.0-100-generic #110-Ubuntu SMP Wed Feb 7 13:27:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

java version "17.0.6" 2023-01-17 LTS Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190) Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)

Quarkus version or git rev

No response

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

Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /opt/apache-maven-3.9.5 Java version: 17.0.6, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-17 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-100-generic", arch: "amd64", family: "unix"

Additional information

Using also the quarkus-langchain4j-ollama extension and the exception might be generated by it.

quarkus-bot[bot] commented 6 months ago

/cc @FroMage (resteasy-reactive), @geoand (jackson,resteasy-reactive), @gsmet (jackson), @stuartwdouglas (resteasy-reactive)

geoand commented 6 months ago

Can you please share the application you are using and that exhibits this behavior?

nicolasduminil commented 6 months ago

Would you be surprised if I'm telling you that I can't ?

geoand commented 6 months ago

🙀

geoand commented 6 months ago

Closing in favor of https://github.com/quarkiverse/quarkus-langchain4j/issues/398

nicolasduminil commented 6 months ago

😾 Closing as contributor isn't willing to provide support

gsmet commented 6 months ago

@nicolasduminil We already warned you once: please change your attitude and your tone. Snarky comments are not welcome. And if you are not willing to provide information, that's your call, not ours.

It is your job to provide all the information required for us to not spend hours trying to reproduce the issues you are reporting, especially since they are sometimes caused by your code or your lack of knowledge.

I strongly suggest you act more positively in the future if you want to get some help from us.