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

Enhancement: Added feature to manually retry failed tasks #737

Closed
wants to merge 1 commit into from

Conversation

tnir
Copy link

@tnir tnir commented Sep 18, 2017

This PR is based on @jiffyjeff's work #158 with follow-up to be ready to be merged.

Enhancement: Added feature to manually retry failed tasks. Added "Requeue" button to task detail view; requeues the task with original args and kwargs using the Flower async-apply API. Supports an existing feature request (#17).

…ueue" button to task detail view; requeues the task with original args and kwargs using the Flower async-apply API. Supports an existing feature request (mher#17).
@tnir
Copy link
Author

tnir commented Sep 18, 2017

@asfaltboy @mher @ask This is a follow-up against #158. I'd like you to review this PR.

@tnir
Copy link
Author

tnir commented Sep 18, 2017

cc @embolalia @xrage @spudfkc

@tnir
Copy link
Author

tnir commented Sep 18, 2017

@jiffyjeff What do you think of this PR?

@SirEdvin
Copy link

Don't work, has problem with args parsing, because send tuple to json.

@jheld
Copy link
Contributor

jheld commented May 3, 2018

@tnir @SirEdvin Would you like any help fixing/testing this?

@tnir
Copy link
Author

tnir commented May 3, 2018

@jheld Yes if you can!

@clintonb
Copy link

What is preventing this from being merged?

@tnir
Copy link
Author

tnir commented Sep 18, 2018

@clintonb As far as I know, someone does not think this PR works well.

@jheld
Copy link
Contributor

jheld commented Oct 6, 2018

Last time I tried to use it, it didn't work. But I'm willing to try again.

@jheld
Copy link
Contributor

jheld commented Dec 7, 2018

One extra issue is that args or kwargs repr could be truncated. If the worker has an increased repr size, that can be a work around -- but out of control of this PR.

Also, is there a way to remember/use any child tasks?

Additionally, if the task result backend is enabled and the args/kwargs are there (newer version of celery, not yet released), then we could take from that if it is available.

@grokpot
Copy link

grokpot commented Apr 2, 2019

+1

@tnir
Copy link
Author

tnir commented Apr 3, 2019

Should I do something to get merged?

@grokpot
Copy link

grokpot commented Apr 4, 2019

@tnir yes please!

@jheld
Copy link
Contributor

jheld commented Apr 4, 2019

If you do, please have a warning in docs or something that this does not re-queue child tasks, and depending on the size of args/kwargs, the re-queue itself might not run (repr may be truncated). The latter can be dealt with as part of running celery, but I don't think the former can.

@jheld
Copy link
Contributor

jheld commented Aug 2, 2019

Another way to do this could be with use of the extended results feature on newer celery (4.3 I think), if all the settings are lined up. If the result backend has the tombstone and that extended setting is enabled, we should be able to get around the repr truncation issue at least.

@mikolaje
Copy link

mikolaje commented Oct 6, 2019

good feature, why can't it be merged?

@jheld
Copy link
Contributor

jheld commented Oct 6, 2019

I think the idea is sound. But there are some caveats/documentation around it that I think would be required in this change should it be merged. If the truncation or extended results are not adjusted per the user, they may not be able to use the retry. That's effectively breakage from the user's perspective, unless there are prominently placed docs.

Due to how celery/events construct tasks and the flow in them, it makes this feature harder. Additionally, what happens if this task is part of a chain? We would like to ensure we can make it possible to call the rest of the chain should this task succeed on manual retry. That's my take, and I feel it's important to get it right if we can. If not, then yes, it could be left off for now.

@jheld
Copy link
Contributor

jheld commented Oct 6, 2019

@mher would you be able to add me as a collaborator/maintainer? I'd like to help merge this (once we agree on readiness/impact).

@mapineda
Copy link

Is there any update on this? @jheld

@jheld
Copy link
Contributor

jheld commented Jun 16, 2020

I feel we're still blocked by at least the truncation issue. If the result backend extended setting support is merged then that will technically allow this to work better (so long as the key is still in the backend, not expired).

So although this is a useful change, it's sitting in a boundary where a lot of folks are going to have breakage, so long as the other pieces aren't addressed.

@mher
Copy link
Owner

mher commented Jun 26, 2020

Closing this pull request because it will only work in limited cases

@mher mher closed this Jun 26, 2020
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

Successfully merging this pull request may close these issues.

9 participants