You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
implement real BatchJob execution per job_type (data_processing/file_conversion/report_generation/backup) #12517
#12439 wires the batch-job scheduling + execution PLUMBING end-to-end:
tasks.run_batch_job (Celery task) transitions a BatchJob pending -> running -> completed/failed, appending log entries, dispatched from both POST /api/batch-jobs/{job_id}/run (on-demand) and the new cron dispatcher.
tasks.dispatch_due_batch_schedules (Celery-beat, every minute) scans BatchSchedule records and enqueues run_batch_job for due+enabled schedules, skipping schedules whose job is already running.
Per job execution itself (_execute_batch_job in autobot-backend/tasks/batch_job_tasks.py) is intentionally a documented no-op / custom stub — it reads job.job_type but does not perform any real work for any BatchJobType.
Suggested fix
Implement real execution for each BatchJobType:
data_processing
file_conversion
report_generation
backup
custom (stays a pluggable/user-defined hook)
Each should replace its branch in _execute_batch_job with real work (or a per-type handler function), update job.progress as it runs, and return a meaningful result dict. Consider whether these belong as dedicated Celery tasks of their own (long-running work should not block the shared run_batch_job executor task).
Carry these hardening items from the #12518 review (deferred here because they only matter once execution does real work): (1) make the schedule CLAIM atomic — current GET→SET claim in dispatch_due_batch_schedules is race-free only under singleton celery-beat + a fast dispatcher; before real execution lands, harden to WATCH/MULTI or a SETNX lock so overlapping dispatcher instances can't double-claim. (2) A permanently-malformed-cron schedule logs a warning EVERY tick (never advances next_run) — suppress the spam. (3) A schedule whose target job was deleted still .delay()s a doomed task each tick — skip it. Refs #12439/#12518.
Dependency cleanup (owner decision, 2026-09-14): removed the native blocked_by link to umbrella #13852. An umbrella can't meaningfully block a single issue, and no reason for the link was recorded here. None of #13852's children blocks this issue either (checked during the version split). If implementing this turns out to need specific telemetry work, link that exact child issue instead. This issue stays in v0.11.0 because it blocks security issue #13625.
Activity
mrveiss commentedon Jul 25, 2026
Carry these hardening items from the #12518 review (deferred here because they only matter once execution does real work): (1) make the schedule CLAIM atomic — current GET→SET claim in dispatch_due_batch_schedules is race-free only under singleton celery-beat + a fast dispatcher; before real execution lands, harden to WATCH/MULTI or a SETNX lock so overlapping dispatcher instances can't double-claim. (2) A permanently-malformed-cron schedule logs a warning EVERY tick (never advances next_run) — suppress the spam. (3) A schedule whose target job was deleted still .delay()s a doomed task each tick — skip it. Refs #12439/#12518.
mrveiss commentedon Sep 14, 2026
Dependency cleanup (owner decision, 2026-09-14): removed the native
blocked_bylink to umbrella #13852. An umbrella can't meaningfully block a single issue, and no reason for the link was recorded here. None of #13852's children blocks this issue either (checked during the version split). If implementing this turns out to need specific telemetry work, link that exact child issue instead. This issue stays in v0.11.0 because it blocks security issue #13625.github-actions commentedon Oct 28, 2026
needs-structure: this issue is missing:M<n> - ...:v0.11.0is not a goal milestonephase:M<n>.<k>label whose<n>matches the goal milestone: found noneParent: #Nin the body), unless this is an umbrella with sub-issuesThe label clears on the next issue event once all three are present (#19522).