Skip to content

Core: MySQL archive wedge, workflows vs archive/spawn, dependency limit parity, archiver policies #111

Closed

Description

@CodingAnarchy

Found in the post-2.4.0 bug hunt.

  1. MySQL archival wedges on retry strategies. 010_add_archival.mysql.sql:31 declares hammerwork_jobs_archive.retry_strategy VARCHAR(50); most serialized strategies are longer (e.g. exponential(1s, 2.0, Some(600s))), so strict MySQL fails the insert with 1406, the batch rolls back, and since candidates are oldest-first every later pass (all queues, incl. WorkerPool::with_archival) fails. Fix: new idempotent migration 020 widening the column (JSON/TEXT).
  2. Workflows never complete once a member job is archived. refresh_workflow (postgres.rs ~2532, mysql.rs ~2851), get_workflow_jobs, get_workflow_status count only hammerwork_jobs. Batches already count archive rows. Fix: include hammerwork_jobs_archive rows by workflow_id (archived status maps like dependency_states), and index hammerwork_jobs_archive(workflow_id) in migration 020.
  3. Spawned children join the parent's workflow without raising total_jobs (src/spawn.rs:514), so the workflow completes early (and a later child failure never fails it). Fix: raise total_jobs for workflow children in complete_job_run_with_children (both backends + TestQueue).
  4. Dependency fan-in limit differs: PG has CHECK array_length(depends_on) <= 1000 (migration 012), MySQL none. Fix: enforce the same 1000 limit at enqueue/validation for both backends (and TestQueue) with a clear error, and document it.
  5. JobArchiver::run_scheduled_pass ignores per-queue policies (archive.rs ~807) though set_default_policy docs say the default applies only to queues without their own policy. Fix: honour per-queue policies.
  6. RetryStrategy::Linear docs (retry.rs ~310) list "5s, 15s, 25s" but calculate_delay(1) is 15s. Fix the docs (or the formula, if the documented one is intended — pick the one consistent with Exponential/Fixed semantics after fix: 2.2.x bug hunt — cron presets, archiver robustness, MySQL parity, TestQueue parity, worker/stats, config/webhooks, CLI and dashboard #99).

Cleanups in the same area: dead JobStatus::Retrying handling notes, stale "counters never updated" comment in postgres.rs/mysql.rs, duplicate priority matches in get_priority_stats (use JobPriority::from_i32), Worker::handle_batch_job_failure extra query, BEGIN;/COMMIT; inside migration 012 (postgres), double-quoted literals in MySQL migrations 010/018/019 (ANSI_QUOTES), MySQL archive TIMESTAMP precision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions