This repository has been archived by the owner on Apr 1, 2023. It is now read-only.
Status never seems to set to failed
after retries complete
#125
Labels
failed
after retries complete
#125
Hi there,
We're having some trouble getting
Sidekiq::Status
to return afailed
status after a job completes its number of retries. I have a test worker as follows:I've also added a debug line into the
sidekiq_status/lib/server_middleware.rb
file, just after an exception is raised:I then queued up a job and monitored the sidekiq server process to see the logging. As expected, the job was tried three times, and here are the extracted debug lines:
First attempt
Sidekiq logs warning excerpt just after this point
Second attempt
Sidekiq log excerpt just after this point
2018-02-20T12:26:58.447Z 23231 TID-oxaaxbv1w WARN: RuntimeError: Just fail
Third attempt
Sidekiq log excerpt just after this point
From this logging, it looks like
retry_count
is only added after the second attempt, i.e. the first retry, but it's set to zero, rather than one. On the third attempt (second and final retry), ourretry_count
is1
, andretry_attempts_from
still returns2
, and so the comparison inSidekiq::Status::ServerMiddleware#call
succeeds andSidekiq::Status
will set our status back toretrying
, even though Sidekiq itself has actually stopped retrying and moved the job to the dead queue.I don't think we have anything particularly strange going on in our app or config; We're using Sidekiq Pro,
Sidekiq::VERSION
is5.0.4
andSidekiq::Status::VERSION
is1.0.1
. We're also using thesidekiq-scheduler
gem, although in my tests here I've disabled it so I don't think it's interfering.Do you have any ideas what's happening?
The text was updated successfully, but these errors were encountered: