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

"Kill" button in retries tab? #1866

Closed
subelsky opened this issue Jul 28, 2014 · 6 comments
Closed

"Kill" button in retries tab? #1866

subelsky opened this issue Jul 28, 2014 · 6 comments

Comments

@subelsky
Copy link
Contributor

hey @mperham what do you think about a button in the Retries UI that moves jobs into the morgue? Sometimes we get exceptions where I'm working on a fix, and I'd like the job to stop retrying while I fix (maybe because it uses up resources) -- but I'd still like to keep the job around and retry it later. It would be cool to save the dead job in the morgue, then "resurrect" it when I'm ready to try again.

@mperham
Copy link
Collaborator

mperham commented Jul 28, 2014

Seems legit to me. Anyone want to PR it?

@seuros
Copy link
Collaborator

seuros commented Jul 28, 2014

I will try to do it. I just have to figure out how to send kill to the jobs.

@mperham
Copy link
Collaborator

mperham commented Jul 28, 2014

The jobs aren't running. You just need buttons to move them from the 'retries' set to the 'dead' set and back.

@seuros
Copy link
Collaborator

seuros commented Jul 28, 2014

I started working in the kill button. So far, i can kill the job and restore it by setting

msg['retry_count'] = Sidekiq::Middleware::Server::RetryJobs::DEFAULT_MAX_RETRY_ATTEMPTS

But i see some flaw with this approach:

  • The job can have a non default value for max retry.
  • We lose the exact count for retry_count.

I would like to know if there is an API to send the the job to the morgue

i found send_to_morgue in Sidekiq::Middleware::Server::RetryJobs, but it a private method and i wanted to ask if i should public it or just use send().

@mperham
Copy link
Collaborator

mperham commented Jul 28, 2014

The job isn't running. It's just sitting in Redis in the retry set and will run some time in the future. You can see it in the Web UI on the Retries tab.

The feature request is a button which can move that retry from the retry set to the dead set. You need to write some code which finds the job in retry set, removes it and pushes it onto the dead set. The current retry options (delete or retry now) are handled here:

https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/web.rb#L163

You could expand the retry_or_delete method to retry_or_delete_or_kill

@seuros
Copy link
Collaborator

seuros commented Jul 28, 2014

Ok, understood. I will do it now.

seuros added a commit to seuros/sidekiq that referenced this issue Jul 28, 2014
seuros added a commit to seuros/sidekiq that referenced this issue Jul 28, 2014
@seuros seuros closed this as completed in 63be43f Jul 28, 2014
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