VOD Docs

Failure handling

How each kind of failure is detected, recorded and recovered from.

A pipeline can fail inside a task (a bad file, an FFmpeg error), between tasks (an error in Celery itself), or by losing the worker entirely. Each case has a different handler, and every one of them ends with the video marked failed and the queue moving on.

Flow diagram · placeholder
Failure decision tree: task error → retry? → task marks failed → link_error → on_pipeline_failed → next video; worker death → startup recovery

One diagram covering all three failure classes and where each is caught.

Three layers of handling

What a failure looks like from outside

WhereWhat you see
Admin upload dialogThe status poll returns is_failed: true and the error message
Admin videos tableProcessing status failed
Watch page"This video is still processing" (no manifest_url), for any video that has not completed
Worker logsThe task's own error lines, plus a [queue] Pipeline failed for video_id: … line

Retrying

A failed video is retried by setting it back to queued. prepare_video clears any leftover working directory from the earlier run before starting.

Safety limits

LimitValueProtects against
Soft time limit per task50 minutesA runaway encode
Hard time limit per task60 minutesA task that ignores the soft limit
Processing lock TTL6 hoursA lock left behind if nothing else releases it
tus admission slot TTL2 hoursAbandoned uploads holding upload capacity

Known gaps

  • The working directory is cleaned only on success, so failed runs leave intermediate files on the worker until the video is retried or the container is recreated.
  • Retry handling inside some tasks (transcode, segment, upload) has edge cases where a retry is counted twice or swallowed. These are tracked in Improvements.
  • A deploy that restarts the worker fails whatever is processing at that moment; it must be re-queued.

On this page