Closed etagwerker closed 9 years ago
@etagwerker Looks solid. Thanks for the contribution and tests!
@ScotterC Awesome! Thanks for the quick response! :beers:
@etagwerker now that you know the codebase, I'd love for any other contributions you can give. Sadly I'm not as active of a maintainer as I used to be
@ScotterC I'll try to help, but I'm already busy with a couple other open source projects.
I disagree. If a record is deleted before the job is processed, it would be natural to expect RecordNotFound error on queue side. If someone wants to prevent the error, the application should explicitly dequeue the job when record is deleted.
For instance, sometimes delayed_paperclip run into race conditions against database (the job is dequeued before database transaction commits***). If queue backend has retry support, raising RecordNotFound error will gracefuly reschedule job.
*\ I still can't figure out why delayed_paperclip has race condition problems even if job seems to be scheduled on after_commit hook.
Agree with previous commenter. We are upgrading delayed_paperclip in our app now. I think we will have problems if the background job doesn't raise an error.
Our app writes to a db master, but will read from a db slave which can have replication lag, meaning sometimes the db row doesn't exist yet when the background processing starts. In those cases we want ActiveRecord::NotFoundError
to be raised and the job to fail so it can be requeued.
We will investigate this potential issue on our end to see if we have to do anything.
Hey @jrgifford!
At my company, we encountered issue #101 while trying to use
delayed_paperclip
with Sidekiq.I think that the best solution would be to ignore instances that have been deleted before the background job gets to the processing part.
Please check it out and let me know if it looks good.
Thanks!