Loss messages from Priority Queue #2120
-
Hello, we have encountered the following issue. When redeploying the application, the old k8s pod stops working, and a new one is deployed. During this process, we lose messages from the priority queue. To process the queues, we use the jobs plugin with the Kafka driver configured with the following settings.
As far as I understand, when messages enter the PQ, the offsets in the topics are immediately shifted. Could you please tell me if it’s possible to set Php worker execute following code:
And we use a 2023.1.1 version of roadrunner app and this |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 19 replies
-
Hey @Buravenkov 👋🏻 |
Beta Was this translation helpful? Give feedback.
-
@rustatian Hello! We have upgraded RoadRunner to version v2024.3.2, but we still noticed that some messages were lost. At the same time, we reduced the size of the priority queue to 100 messages, and during a redeployment, we saw that messages from this queue were read within 3 seconds. However, 67 messages were still lost. Because of this, we have a question: do we need to explicitly handle graceful shutdown signals in the PHP code of the workers and implement some logic that prevents the worker from terminating until it has completed all the tasks that the pollers loaded into its memory? I couldn't find any information in the documentation that confirms or refutes the claim that a jobs worker will complete all tasks loaded into its memory when RoadRunner receives a shutdown signal. P.S. We are sending a SIGTERM signal to stop it. |
Beta Was this translation helpful? Give feedback.
Hey @Buravenkov 👋🏻
I was told about that literally in the first message 😃
Unfortunately, you can't achieve that with RR. RR sends messages to the first free workers in the stack. So only having 1 worker you ma…