roadrunner
roadrunner copied to clipboard
[🐛 BUG]: Delete all items from the priority queue on the pipeline destroy command
No duplicates 🥲.
- [X] I have searched for a similar issue in our bug tracker and didn't find any solutions.
What happened?
When the user calls rpc.Destroy for the pipeline, some jobs might already be in the priority queue. Since the priority queue is global for all pipelines, jobs from the destroyed pipeline might reach the worker. RR won't be able to ACK/NACK these JOBS, but they might sometimes break user logic inside the worker.
We should delete all associated JOBS from the PQ and wait for the msgInFlight == 0 to be sure that there are no JOBS inside the PQ or currently processing by the PHP worker.
Version (rr --version)
<= 2.12.1
How to reproduce the issue?
- Start RR.
- Use a simple JOBS worker with a
sleep(1). - Push a lot of JOBS and call
rpc.Destroywith the pipeline name simultaneously.
- [x]
AMQP - [x]
SQS - [x]
Beanstalk - [x]
NATS - [x]
Kafka - [x]
in-memory - [x]
boltdb
The second part of this bug is to introduce an option to wait for the jobs currently being processed by a worker.