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
Regression on fetchAndLock long poll (asyncResponseTimeout waits until timeout) #438
Comments
This time I remembered to build and run demo projects from JAR files (because asyncResponseTimeout does not work on Maven project otherwise, as discussed in the original asyncResponseTimeout issue long time ago). |
Hi @datakurre , |
@tobiasschaefer Yes. I started from 2.10.0 and tried all versions down to 2.7.2, which worked. |
The broken version 2.8.0 basically only contains one commit which zu updates Micronaut from 3.4.4 to 3.5.2: eb51252 I'll take a closer look. |
I double checked that the issue existed already on 2.8.0. It does. |
@tobiasschaefer I spent some time with debugger and found the following difference between 2.7.2 and 2.8.0 When a process enters external service task, the following transaction listener is fired in 2.7.2 but no longer in 2.8.0 (the method is called to register the listener, but it never fires), and therefore long poll request does not get the signal about new task and waits until the timeout: |
Thanks for that detailed analysis. It must be related to Micronaut's transaction handling which changed in 2.8.0. I'll have a look. |
🤩 |
Thanks to this, I know now much better, how Camunda long polling works. I was not aware that only new tasks are immediately delivered, because of that event being triggered. Tasks with silently expiring lock, are only redelivered after asyncResponseTimeout (or with tasks that fired that event). Therefore, optimal asyncResponseTimeout might be surprisingly short. A compromise between not polling all the time, but poll often enough to also deliver those exceptions in timely manner. |
Hey @datakurre , can you please test release v2.11.1. It fixes the issue for me. Note to myself:
Process Model: |
@tobiasschaefer I can confirm the fix. Thanks again! |
The last version where asyncResponseTimeout for REST API external task long poll works properly is 2.7.2
Minimal working demo: demo-2.7.2.zip
Here I start a long poll and then start a new instance of a process and get response immediately after starting the instance, which is much less than 10 seconds of asyncResponseTimeout:
Minimal failing demo: demo-2.10.0.zip
Here I do the same, but I only get the response after asyncResponseTimeout of 10000 has exceeded:
The text was updated successfully, but these errors were encountered: