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

A restarted task should have the same identity as far as the client is concerned #7929

Closed
jonboiser opened this issue Mar 26, 2021 · 3 comments · Fixed by #7950
Closed

A restarted task should have the same identity as far as the client is concerned #7929

jonboiser opened this issue Mar 26, 2021 · 3 comments · Fixed by #7950
Assignees
Labels
P1 - important Priority: High impact on UX
Milestone

Comments

@jonboiser
Copy link
Contributor

jonboiser commented Mar 26, 2021

Observed behavior

  • Add /api/tasks/restarttask endpoint #7905 Implemented a API endpoint to restart tasks with only the canceled or failed task's ID.
  • When a task is restarted, a new job is enqueued that has the same parameters of the old one. So it is "identical" in all respects except the job's ID.
  • When the client polls /api/tasks/tasks, after the task is restarted. Task with the original ID disappears, and the new one appears.
  • Because the client uses the task ID to manage the Task Manager card with the task progress, this results in the old task disappearing and being replaced by the new one, etc.

See Video in #7905 (comment)

Expected behavior

When the client requests /api/tasks/tasks after the task is restarted, the restarted task remains in the response payload, but just has its status updated.

Ideally, the result on the UI will be that, after the task is restarted, the Task in the Task Manager will simply go from a canceled/failed state to a running state, without having to disappear/reappear.

Technical notes

This can probably be done by replacing this line

https://github.com/learningequality/kolibri/blob/develop/kolibri/core/tasks/queue.py#L80

With job.job_id = job_id.

@jonboiser jonboiser added the P1 - important Priority: High impact on UX label Mar 26, 2021
@jonboiser jonboiser added this to the 0.15.0 milestone Mar 26, 2021
@vkWeb
Copy link
Member

vkWeb commented Mar 27, 2021

@apurva-modi would you mind if I attempt at solving this issue? 😅

Because I want to understand the task api as I plan to work on it in gsoc so this will give me a hands-on chance to explore and understand the task api.

@jonboiser if for some reason the issue assignment cannot change then can you suggest me some issues that require work on task api? :)

@jonboiser
Copy link
Contributor Author

@vkWeb Feel free to explore the Task API. If you end up fixing this issue, as well as the tests related to it, I'd be happy to look at your PR.

This other issue (re: tasks losing their metadata after the server is restarted) is also a good issue that you can focus on. #6255

@vkWeb
Copy link
Member

vkWeb commented Apr 1, 2021

@jonboiser hey, thanks for the chance! Okay - I've started my work on this one. Once I properly fix this then I'll move on to #6255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 - important Priority: High impact on UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants