laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.88k stars 658 forks source link

WithoutOverlapping key "laravellaravel-queue-overlap:" #1509

Open maxvisser opened 1 month ago

maxvisser commented 1 month ago

Horizon Version

^5.19

Laravel Version

^11.0

PHP Version

8.3.8

Redis Driver

Predis

Redis Version

^2.2

Database Driver & Version

No response

Description

When we forcefull terminate a horizon supervisor without running horizon:terminate. It can leave a overlapping key in Redis which does not have a TTL.

"laravellaravel-queue-overlap:"

I would be nice if the overlapping key would have a TTL or that the dashboard shows that the maxAttempts are reached because of it failing instantly as there is an overlapping key set.

As there is no visual indication in the dashboard that the job failed based on failing because of a maxAttempt this was not an obvious problem to resolve for us.

Restarting horizon supervisors or the container which executes the master process also does not resolve this issue.

Steps To Reproduce

When you queue a job with ->WithoutOverlapping and it is excecuted on your queue, keep the overlapping key in your redis. All new jobs will go directly to their maxAttempts.

github-actions[bot] commented 1 month ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!