vapor / queues

A queue system for Vapor.
MIT License
169 stars 40 forks source link

Jobs getting stuck in processing #137

Open theoks opened 3 weeks ago

theoks commented 3 weeks ago

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

gwynne commented 3 weeks ago

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 commented 3 weeks ago

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?