Closed ivanistheone closed 2 years ago
@rtibbles I'm able to replicate this issue in v0.14.7-rc1. The percentage bar always goes right to 100% and I can see in the Network tab multiple api calls with response:
[{"status":"COMPLETED","exception":"None","traceback":"","percentage":0,"id":"d0d7038858a74f4d8c0a069fc0a26001","cancellable":false,"clearable":true},{"status":"COMPLETED","exception":"None","traceback":"","percentage":1.0,"id":"2f10550b8a914b27b02256380115fc60","cancellable":true,"clearable":true,"channel_id":"171ade4c27294b03a1fbff97d3079e15","channel_name":"Studio Test Channel 4","exclude_node_ids":null,"node_ids":null,"started_by":"1db2f06922620cab9f41d05188c14431","started_by_username":"pcenov","baseurl":"https://studio.learningequality.org","peer_id":null,"type":"UPDATECHANNEL","new_version":19,"database_ready":true,"file_size":50411,"total_resources":2,"transferred_file_size":50411,"transferred_resources":2}]
Thanks @pcenov!
This issue is caused by sequential updates to the job object within the task. When job.update_progress
is called here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/tasks/api.py#L1185 the subsequent calls to save_metadata
inadvertently overwrite the progress data, because it is never set on the job itself.
To fix this, the update_progress method https://github.com/learningequality/kolibri/blob/44bf1ed3591321f4b7ef7c4e5c6ceda8c01db7ae/kolibri/core/tasks/job.py#L126 should also set progress
and total_progress
onto self, as well as putting it into the storage with the method.
Observed behavior
While trying to update ASB channel on kolibridemo, I went through the wizard that showed me the version "changelog" then when I started update task I saw it jump to 100% progress right away:
Expected behavior
Progress bar steadily growing from 0 to 100%.
User-facing consequences
Confusing since UI says 100% but task is still running.
Errors and logs
From the netowrk tab, I saw polling of the task api url with the following response:
I'm not sure what the COMPLETED tasks are, but the
UPDATECHANNEL
channel task percentage shouldn't be 1.0.Also the
"node_ids"
was a huge list of 6000+ rows, which seems weird to be including in the status progress polling, but did not cause any noticeable slowdown. It's just text.Steps to reproduce
Context