-
Notifications
You must be signed in to change notification settings - Fork 91
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
Unsupported states crash Progress reporting #54
Comments
Note that after #52, unsupported states do not crash celery-progress but do show an error (except ignored tasks). Regarding Also, we should test what happens:
|
For For I can't seem to find any example usages of |
Makes sense. The frontend will need to know which tasks are ignored. Either the user passes an argument when starting the bar, or the value of result.ignored is included in get_info.
I'll try to get to it soon. If it works as expected, the user should enable it in their own tasks/celery configuration if they want its behavior. |
I'd also like to see Ideally, lib should support any user-defined custom state. For example by inheritance, or registering handlers. For |
@norbertcyran I can see about the |
@EJH2 @shared_task(bind=True, base=AbortableTask)
def abortable():
for _ in range(100):
if self.is_aborted():
return
do_sth() So I'd expect payload more like: {
"completed": false,
"state": "ABORTED",
"progress": {...}
} |
@norbertcyran All |
@EJH2 And that's exactly what I expect in my use case. When you call |
@norbertcyran Understood. Do you believe it would be more appropriate if the progress bar maintained it's current progress from when it was aborted, or should it fill up to max? The bar will fill to max once it hits a SUCCESS or FAILURE state, but we don't really have a precedent set for intermediary states. Still curious on how we would support other user-defined states, though. |
I defined a task as follows:
I raised an error inside the task and the FAILURE state was not ignored. |
Currently, there seems to be two task states that will slip past the currently accounted for states in
Progress.get_info()
:stop_task()
as demonstrated in Stopping celery task #4,stop_task()
will function as expected. However, ifstop_task()
is not used, upon finishing the task, the result backend will still have thePROGRESS
state, meaning the client-side javascript will continue to request the same resource over and over again until the page is closed.stop_task()
, it works fine. Without, the progress bar will get to max but never complete, and as the task has already technically finished, no further updates will be sent. The JS will be left to sit, waiting for a response that will never come, and will wait until the server times out the connection.Both situations pose an interesting challenge on how they'll be handled. For
IGNORED
, it may be worth revisitingstop_task()
's implementation and offering a possibly better solution than what is currently being used. Successfully fixing the handling forRETRY
could eventually pave the way for #13 to get some as love as well. Thoughts on this would be greatly appreciated!The text was updated successfully, but these errors were encountered: