-
Notifications
You must be signed in to change notification settings - Fork 20
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
Status of Parent task not depending on progress vs.total #91
Comments
That's on the Huey side: If your main task just fires the sub tasks, then it's completed and Huey send this signal. Don't know if there is something in Huey to recognized this. Think you have to "wait" in your main task that all sub task are finished... But if you wait, than maybe to ran into a deadlook, if some of the sub tasks has a problem?!? Quick idea: Maybe the main task can "wait" until all sub tasks signals are one of these:
|
Thanks Jens, Exploring further the code for v0.5.0, I had another idea that will require less access to database. I'm testing this idea locally since yesterday. I'll propose you as well some things I have been using and could prove useful to other users |
Used for displaying parent_task progression (cf boxine#91)
cf boxine#91: displaying progression for parent_tasks if execution is on-going (format: f'{obj.progress_count}/{obj.total}') or last_signal
Now you have the different PRs I saw also that one of the automatic test didn't succeed, but I have no clue why. |
I just realized this morning that in the admin, the parent_task with the sub-task which was latest updated only appeared in 4th position.
|
cf boxine#91: update update_dt of the parent task when a signal is received from a sub-task
#91 display progression for on-going parent_tasks
Sounds a good idea! |
Revert "#91 display progression for on-going parent_tasks"
I saw you merged than reverted. |
I have a currently running task which runs for 10-15h and has a duration of 30.5 seconds :-) |
Yes, see: #96 (comment) Think it's all a little complicated.
Then we have two kind of "Task/Subtask" usage:
The first one, is easy and the current supported implementation: All subtask progress are cumulate to the main task. The test project contains the django-huey-monitor/huey_monitor_tests/test_app/tasks.py Lines 85 to 131 in fbb9741
For the second (your) case: We didn't have a example in test project. We should add a example to test everything. About the main-/subtask status: This we have to implement some logic here for all usecases to display the "effective status" of the main task, e.g.:
Think this can be done independent in a separated PR. |
Hi Jedie, It took me some time to go through. I must say that I don't fully follow your manipulations with PRs, reversion & all. I did integrate the test project as part of the testing files in PR #97. I agree with your analysis, and the last part (main-/subtask status), I'm less confortable with the implementation |
could you give me a feedback on this? |
Hi @jedie, I think I found an "easy" solution for this:
That way, the last_signal will be associated to the parent task in addition to the sub-task
We could easily prevent this "error" status to be overwritten, for instance by checking, at the begining of
the main drawback for me would be that we are loosing the information that there is still a task running So I would prefer the situation where the main-task is always associated with the latest signal of the sub-tasks What do you think ? |
Hi,
My tasks are organised as a set of sub-tasks
completion of each sub-task is adding 1 to the progress of the parent task
however if you look at the first snapshot that shows only the columns visible without scrolling, one could think that all activities are complete and that it would be ok to switch off the server.
But if you scroll right to see the progression data, the situation is very different:
At the moment, the status of the Parent task is not related at all to the task progression (
TaskModel.progress_info[0]
vs.TaskModel.total
)In my use case, that would be necessary to take task progression into account when a total is specified.
How could I ensure that the "signal_complete" is not sent before each sub-task is complete?
and that it is sent once the last sub-task has been completed?
The text was updated successfully, but these errors were encountered: