Jobs getting stuck in processing
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
- Create a job and throw an exception in the
dequeuehandler.
Outcome
Jobs are getting stuck in processing in the DB.
Additional notes
No response
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.
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?