Skip to content

implement real BatchJob execution per job_type (data_processing/file_conversion/report_generation/backup) #12517

Open

Description

@mrveiss

What

#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).

References

Activity

  1. mrveiss commented on Jul 25, 2026

    @mrveiss
    OwnerAuthor

    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.

  2. modified the milestones: Backlog, v0.11.0 on Sep 12, 2026
  3. mrveiss commented on Sep 14, 2026

    @mrveiss
    OwnerAuthor

    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.

  4. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Oct 28, 2026
  5. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    needs-structure: this issue is missing:

    • a goal milestone M<n> - ...: v0.11.0 is not a goal milestone
    • a phase:M<n>.<k> label whose <n> matches the goal milestone: found none
    • a native parent issue (add one, or write Parent: #N in the body), unless this is an umbrella with sub-issues

    The label clears on the next issue event once all three are present (#19522).

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

    area: workflow-engineWave 1 · cluster AC — Workflow engine & schedulersbackendneeds-structureMissing goal milestone, matching phase label or native parent (#19522)

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions