Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq (3.2.5) not respecting retry specification #1966

Closed
bobber205 opened this issue Sep 23, 2014 · 11 comments
Closed

Sidekiq (3.2.5) not respecting retry specification #1966

bobber205 opened this issue Sep 23, 2014 · 11 comments

Comments

@bobber205
Copy link

Got the following code

require 'sidekiq'
require 'sidekiq/api'

class MaintainerWorker
  include Sidekiq::Worker
  sidekiq_options :retry => 2
  def perform(action_data)
    action_data = JSON.parse action_data
    puts 1/0
  end
end

Couple issues

Without

require 'sidekiq/api'

it wouldn't retry jobs at all, I'm assuming without that include that sidekiq_options silently fails?
That would really tricky to figure out.

~~

While it's now retrying my job when it fails to divide by zero, it retries up 5+ times, at least as long as I've waited, not the time times I've specified. What's up?

@mperham
Copy link
Collaborator

mperham commented Sep 23, 2014

1 should not be true. Please give us an error backtrace.

@seuros
Copy link
Collaborator

seuros commented Sep 23, 2014

do you have any sidekiq plugin ?

@bobber205
Copy link
Author

There was no error. Just me watching the sidekiq web interface seeing it process the job, get it sent failed and never retried.

@mperham
Copy link
Collaborator

mperham commented Sep 23, 2014

Nothing in the logs?

@bobber205
Copy link
Author

For #2
Seeing

 {"retry"=>true, "queue"=>"default", 

whenever my job retries in the console where I'm running the sidekiq process.

@bobber205
Copy link
Author

weird. suddenly not able to repo #1.

@bobber205
Copy link
Author

@seuros No plugins. Just installed sidekiq this morning.

@bobber205
Copy link
Author

Going to just close this.
My bad. 👎
I was queueing using a PHP api and I didn't realize that the options for a job when queuing manually with have to be specified at time of enqueuing. Working as intended.

@mperham
Copy link
Collaborator

mperham commented Sep 23, 2014

It's possible you have an old Sidekiq process running which loaded an old version of the code where that option wasn't set.

@mperham
Copy link
Collaborator

mperham commented Sep 23, 2014

👍

@bobber205
Copy link
Author

We're all really liking sidekiq so far. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants