Skip to content

fix: mark the failed key published so retry work can consume it - #23

Merged
beagleknight merged 1 commit into
mainfrom
fix/failed-queue-published-marker
Jul 2, 2026
Merged

fix: mark the failed key published so retry work can consume it#23
beagleknight merged 1 commit into
mainfrom
fix/failed-queue-published-marker

Conversation

@beagleknight

Copy link
Copy Markdown
Collaborator

Problem

v1.0.0 added a published-marker gate: work refuses to run a key unless a <key>:published marker exists in Redis, written only by specbandit push.

The flaky-retry flow records failing batches onto a failed queue (SPECBANDIT_KEY_FAILED) via record_failed_filesqueue.push(...), which never marks the key published. So a retry pass (work --key <failed-key>) crashes with 'was never published'. This broke Factorial CI's backend/frontend flaky-retry once the 1.0.0 packages went out.

Fix

record_failed_files now calls queue.mark_published(key_failed, ttl: key_ttl) right after pushing the failed files, so a later work pass can consume the failed queue. (The empty-fallback — extract_failed_files(result) || files + return if empty — was already correct here.)

Tests

  • Assert mark_published(key_failed, ttl:) is called after a failing batch, and not when the batch passes.
  • Allowed mark_published on the queue double by default so existing push specs tolerate the new call.

Ships as v1.0.1 via the Release workflow after merge.

The 1.0.0 published-marker gate makes `work` refuse any key without a
`<key>:published` marker. record_failed_files populates the failed key
(SPECBANDIT_KEY_FAILED) via queue.push, which never sets the marker, so a
retry `work --key <failed-key>` pass crashes with 'was never published'.
Mark the failed key published right after recording its files.
@beagleknight
beagleknight marked this pull request as ready for review July 2, 2026 06:20
@beagleknight
beagleknight merged commit 24daeb3 into main Jul 2, 2026
3 checks passed
@beagleknight
beagleknight deleted the fix/failed-queue-published-marker branch July 2, 2026 06:21
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