disque-module icon indicating copy to clipboard operation
disque-module copied to clipboard

Add [DELAY <delay>] argument to NACK command

Open mvrhov opened this issue 5 years ago • 2 comments

So the consumer can delay the requeing of failed job.

mvrhov avatar Dec 12 '19 10:12 mvrhov

Hi @mvrhov, I wonder when this is useful, but I guess that's something like: the worker failed to process the job but it knows that later it will be more likely to succeed, is it correct? In that case, to just send WORKING + NACK should solve the problem, at least somewhat. But I see here that you would like to specify exactly how much the re-queueing should be delayed. With WORKING you delay the job exactly by the retry error. I'll give some more thoughts on it, thank you.

antirez avatar Dec 12 '19 10:12 antirez

It might be that the worker failed due to network connection problem and if e.g there is only a few jobs in the q then the job will get queued almost immediately. The problem with that is that if you implement the dead letter (DL) queue and push the jobs with more than 100 nacks to that queue that the DL would fill up immediately.

Another example would be something like webhooks where one would calculate delay of the nacked jobs using an algorithm. Something like postfix does when t cannot deliver an email.

mvrhov avatar Dec 12 '19 14:12 mvrhov