collectiveidea / delayed_job

Database based asynchronous priority queue system -- Extracted from Shopify
http://groups.google.com/group/delayed_job
MIT License
4.81k stars 955 forks source link

Worker crashes and keeps poison-pill-job in queue #1173

Open fnordfish opened 2 years ago

fnordfish commented 2 years ago

When a Job raises an exception with a non default encoded message string, Delayed Job crashes with Encoding::CompatibilityError.
Demo with stack trace: https://github.com/fnordfish/activejob-poison-pill-demo

When using SQLite as storage and a Job changes one of it's arguments to something incompatible with SQLite, it will crash with Encoding::UndefinedConversionError.
Demo with stack trace: https://github.com/fnordfish/activejob-poison-pill-demo/tree/sqlite-writeback

In both cases, the job stays in the queue and when restarting the worker, it will immediately retry that job, causing it to crash again.

I was originally investigating this as rails/rails#45418. Maybe ref #1157.