-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't workinggood-first-issueGood for newcomersGood for newcomers
Description
Description
In app/tasks/download_tasks.py (~line 218), the download_video_task attempts to handle task failures by setting the video status to FAILED:
except Exception as exc:
logger.exception("Download failed for video %s", video_id)
# Mark as FAILED if we've exhausted retries
try:
video = db.get(Video, video_id)
if video and self.request.retries >= self.max_retries:
video.status = "FAILED"
db.commit()However, if an exception occurs that is not included in autoretry_for=(RuntimeError,) (such as a database error, missing file, or JSON parsing failure), the task crashes immediately on the first attempt where self.request.retries is 0.
Since 0 >= 3 is false, the status is never updated to FAILED. The task dies, and the video is permanently stuck in the DOWNLOADING state, locking up the UI.
Suggested Fix
Modify the exception block to mark the video as FAILED if the retry limit is exhausted OR if the exception being caught is not retryable (i.e. this is the final terminal failure).
File Path
app/tasks/download_tasks.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood-first-issueGood for newcomersGood for newcomers