-
Notifications
You must be signed in to change notification settings - Fork 413
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
Auto-removal of jobs with duplicate jobId #1799
Comments
My workaround is to check for expired completed jobs in the
|
The ability to ignore a duplicate job or not depending on the age of the job seems to me like an interesting feature, however, restrictions must exist depending on which state the job is. For example, if the job is active we should not replace it with a new job to avoid side effects. |
@manast. I agree that it should be depending on the state. For my use case it would be sufficient to check for expired age with duplicates in state completed. |
hi @nocodehummel, I recommend you to check our new debounce logic available since v5.11.0 |
Great, thanks! |
@roggervalf I have implemented the debounce feature for a specific queue which improves duplicate job handling when the jobId is not set. However the problem with a stalled queue exists for flow jobs that use jobId. When all jobIds exist on the queue the removeOnComplete is never triggered since it always results in a duplicate event (before doing anything else). This deadlock situation occurs when all jobs are run within the removeOnComplete age. |
The lazy auto-removal triggered when a new job fails or completes does not work in my use-case. The goal is to call an external API once per hour for all my Objects. Each object is added to the queue with the jobId set to the Object id.
My queue has completed jobs with an unique jobId for all my Objects that should expire after one hour. Since all Objects are in the queue it will not trigger
completed
orfailed
events. When I add an Object to the queue it triggers aduplicate
event.The
duplicate
event is a duplicate of an expired jobId, which should have been removed from the queue. I would prefer the new jobId to be queued and replace the expired job with the same jobId.My preferred solution would be to include an age check into the duplicate check. When the job age has expired the expired job is replaced with the new job, and it does not trigger a duplicate event. The new job will get completed/failed which also triggers a lazy auto-removal of other expired jobs.
I think this features is important to prevent a queue to stop working. In my case where all jobs are in the queue, and new jobs added always have an existing jobId the queue no longer works.
The text was updated successfully, but these errors were encountered: