Skip to content

Research and tune download failures across API and Celery #6704

Description

@patphongs

What we’re after

Research and implement better handling for download failures across the API and Celery apps.

Logs show jobs can hit DB statement timeouts. The task writes download-failed:<task_id> for the API flow, but Celery reports the task as succeeded.

Action item(s)

  • Decide whether Download failed should re-raise so Celery marks the task failed.
  • Add a distinct metric or structured log for download failures, especially DB statement timeouts.

Completion criteria

  • API and Celery failure behavior is documented.
  • Download failures are visible through Celery logs.
  • When API download fails, Celery should fail.

References/resources/technical considerations

  • webservices/tasks/download.py: generic Exception logs Download failed, writes Redis failure state, and does not re-raise.
  • webservices/resources/download.py: API polling reads download-failed:<task_id> and returns HTTP 500.

Activity

  1. added this to the 33.1 milestone on Sep 14, 2026
  2. moved this to 🔜 Sprint backlog in Website projecton Sep 15, 2026
  3. modified the milestones: 33.1, 33.2 on Sep 29, 2026
  4. cnlucas commented on Sep 29, 2026

    @cnlucas
    Member

    except Exception:
    # sets download-failed in Redis
    logger.exception("Download failed...")
    task_utils.delete_redis_value('download-queued:{}'.format(task_id))
    task_utils.set_redis_value('download-failed:{}'.format(task_id), True, age=7200)

    I believe this succeed behavior is because there's no raise, it returns NONE which then celery views as suceeded

  5. modified the milestones: 33.2, 33.3 on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions