Skip to content

submission_status_cleanup only recovers Running submissions — Submitted, Preparing, and Scoring hang forever #2413

@hanane-ca

Description

@hanane-ca

Bug

submission_status_cleanup() in src/apps/competitions/tasks.py only filters submissions with status=Running:

submissions = Submission.objects.filter(status=Submission.RUNNING, has_children=False)

Submissions stuck in Submitted, Preparing, or Scoring are never recovered by the periodic cleanup job. They hang indefinitely and permanently consume the participant's quota.

How it happens

A submission can get stuck in a non-Running state when:

The existing cleanup only covers Running with a 24h + execution_time_limit threshold. All other non-terminal states are ignored.

Impact (observed in EEG Foundation Challenge, NeurIPS 2025)

  • 8,328 total submissions, 51% never scored
  • 3 submissions were still stuck in Preparing at the time of data export (months later)
  • Stuck submissions consume quota (models.py:342 excludes only Failed, not Cancelled/Scoring/etc.), so participants lose attempts permanently
  • The existing started_when check also crashes with a NoneType comparison for submissions that never reached Running (no started_when value)

Fix

Extend the filter to all non-terminal states (Submitted, Preparing, Running, Scoring) and use created_when as fallback when started_when is null.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions