1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/lib/sidekiq/middleware/server
Mike Perham 3b5862492a Remove job duplication edge case with Sidekiq Pro, fixes #3388
In #2531, we saw how an IO exception in the logger could cause a job to fail and be deleted before it reached the RetryJobs block, causing job loss.  To fix this, we disabled job acknowledgement until job execution starts but this has the bad side effect of duplicating jobs if the user is running a reliable scheme and the error happens after the RetryJobs middleware but before execution starts.

Instead we flip the middleware ordering; logging now happens within the retry block.  We would lose context-specific logging within retry so we move the context log setup out of the middleware into the Processor.  With these changes, we can properly retry and acknowledge even if there are errors within the initial server middleware and executor calls.

This code path has been reimplemented in Sidekiq 5.0 so this change only applies to 4.x.
2017-03-15 10:03:47 -07:00
..
active_record.rb Don't load AR middleware at all unless AR::Base is defined, #1666 2014-04-24 21:37:20 -07:00
logging.rb Remove job duplication edge case with Sidekiq Pro, fixes #3388 2017-03-15 10:03:47 -07:00
retry_jobs.rb Fixnum -> Integer replacement and Ruby 2.4 support for Travis. (#3293) 2016-12-26 08:47:00 -08:00