Skip to content

Skip corrupt jobs in list and include corrupt_jobs_count in response - #519

Open
jmadler wants to merge 3 commits into
Parallels:masterfrom
Radimal:pr/list_corrupt_jobs
Open

Skip corrupt jobs in list and include corrupt_jobs_count in response#519
jmadler wants to merge 3 commits into
Parallels:masterfrom
Radimal:pr/list_corrupt_jobs

Conversation

@jmadler

@jmadler jmadler commented Feb 15, 2026

Copy link
Copy Markdown

Description

When listing jobs (e.g. /data/jobs///...), a single missing or corrupt job (e.g. NoSuchJobError or DeserializationError from queue.fetch_job()) can make the whole list request fail with a 500. That makes the jobs UI brittle when Redis has stale or corrupted job IDs in a registry.

This change fixes with two improvements:

  1. get_queue_registry_jobs_count
    Fetches each job in a loop and catches NoSuchJobError and DeserializationError. Corrupt/missing jobs are skipped and counted. The function still returns total registry size and the list of successfully fetched jobs, and now also returns a third value: the number of skipped (corrupt) jobs.

  2. list_jobs Uses the new 3-tuple and includes corrupt_jobs_count in the JSON response so the UI or API consumers can show how many jobs were skipped.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run tests (pytest) that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG.md file accordingly
  • I have added tests that prove my fix is effective or that my feature works

- get_queue_registry_jobs_count: safe fetch per job, skip NoSuchJobError/
  DeserializationError, return (total_items, jobs, corrupt_count)
- list_jobs: include corrupt_jobs_count in JSON response
- README: document list resilience and corrupt_jobs_count
@cjlapao

cjlapao commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

@jmadler we did not have any response back, we will wait for one more week and then close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants