queues icon indicating copy to clipboard operation
queues copied to clipboard

Jobs getting stuck in processing

Open theoks opened this issue 1 year ago • 2 comments

Describe the issue

If an exception is thrown in the dequeue function, the jobs are stuck in processing, and they never complete.

Vapor version

4.106.0

Operating system and version

macOS 14.7

Swift version

SPM - Swift 6.0.0

Steps to reproduce

  1. Create a job and throw an exception in the dequeue handler.

Outcome

Jobs are getting stuck in processing in the DB.

Additional notes

No response

theoks avatar Oct 18 '24 18:10 theoks

Thanks for refiling this! I'll see what I can come up with for a fix as soon as I can, probably this coming weekend.

gwynne avatar Oct 18 '24 18:10 gwynne

So at a quick look through the code, errors thrown from dequeue() are caught and handled by the retry-or-fail machinery. From what I can tell, the only way for a job to get stuck under these conditions is if it subsequently also throws an error from its error() method. Is it possible that's happening in your case?

gwynne avatar Oct 18 '24 19:10 gwynne