Skip to content

Batch mode and live update follow-ups from the 2.1 bug hunt #94

Closed

Description

@CodingAnarchy

Found by the bug hunt that produced #93; left out of it because they're lower severity or need design work. None of them needs a breaking change.

  1. FailFast batches with claimed jobs. When a JobBatch with PartialFailureMode::FailFast fails, only its Pending jobs are cancelled. Jobs of that batch that a batch-mode worker has claimed but not started are Running, so they still run. Fix: the worker should check, before starting a held job, whether its batch has failed (as fix: batch-mode pause, weighted batch claim loss, undecodable rows in the reaper and MySQL claims #93 does for pause), and if so cancel or release the job.
  2. Dashboard live updates miss Running → Pending transitions (retries, reaper requeues, batch releases). recent_job_changes (hammerwork-web/src/api/history.rs) only looks at the created/started/completed/failed/timed-out timestamps, and none of them changes on those writes. The bundled dashboard still refreshes through QueueUpdate, but other WebSocket consumers miss the transition.
  3. Batch-mode processing time includes waiting time. started_at is the claim time, so statistics and started_at-based durations for held jobs include the time they waited in the batch. Record the actual start, or measure duration from when the handler starts.
  4. A held job skipped as lost doesn't refund its rate-limit token.

Each fix needs a regression test, with timing margins that hold up under the instrumented coverage run.

🤖 Generated with Claude Code

Activity

  1. CodingAnarchy commented on Oct 11, 2026

    @CodingAnarchy
    OwnerAuthor

    More findings from the simplification pass (#95), all non-breaking:

    CLI

    • backup.rs (~322/423) and migration status connect with DatabasePool::connect, ignoring connect_timeout_secs; they should use connect_with_config.
    • maintenance vacuum reports the counts from before the delete as "Deleted N" and ignores the number of rows actually affected.
    • monitor's status_icon table has no entries for retrying or timed_out.
    • webhook update --name can rename a webhook to a name that already exists, although add rejects duplicates.
    • maintenance (~356): the "no update for N hours" text actually filters on started_at.

    Web

    • stats.rs (~350) and system.rs (~349): uptime_seconds() as u64 wraps if the clock goes backwards (stats.rs ~423 already clamps).
    • Job sorting in jobs.rs only treats lowercase "asc" as ascending.
    • An archive dry run returns zeroed stats.

    Tests

    • batch_tests.rs (~244) computes an ordering check and never asserts it.
    • worker_batch_tests::test_batch_statistics_tracking asserts nothing about the statistics.
    • Tests that leave jobs behind in the shared database: result_storage_tests, result_config_test, jobrow_query_tests, test_mysql_concurrent_dequeue.
    • encryption_basic_tests.rs (~893) changes VAULT_TOKEN with unsafe while other tests run in parallel, and doesn't restore it if the test panics.

    🤖 Generated with Claude Code

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions