fix(queue): prevent expired publications from starving later results#607
fix(queue): prevent expired publications from starving later results#607snowzlmbot wants to merge 1 commit into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
617da3b to
0aab94a
Compare
0aab94a to
258c127
Compare
|
Rebased onto current main with superseded changes removed. The remaining publication-fairness fix has full hosted CI and exact-head CodeQL evidence in the updated PR body. @clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks for rebasing the PR and narrowing the publication-fairness suggestion. Recent maintainer work resolving the incident has restored live review publication and backlog drain. To keep the system stable while maintainers discuss the intended wider queue and state model following #592, we are closing this PR without merging. The expired-unclaimed-publication fairness idea remains useful context for any future maintainer-led work; this close is not a reflection on the effort or evidence in the PR. |
First submitted: July 15, 2026, 12:57 PM (US Eastern Time) / 16:57 UTC.
Last body edit: July 15, 2026, 11:23 PM (US Eastern Time) / 03:23 UTC.
Latest head commit: July 15, 2026, 11:08 PM (US Eastern Time) / 03:08 UTC.
Related: #606
Summary
Prevent repeatedly unclaimed exact-review publications from monopolizing the bounded publication lane after their claim leases expire.
The original broad #607 patch has been rebased onto current
mainand reduced to the one fairness gap not already covered by #610, #614, #616, and #617.Breaking changes
None. Queue payloads, stored item schema, publication capacity, claim and completion tuples, stale-lease rejection, workflow permissions, immutable artifact validation, and target-serialized routing are unchanged.
What Problem This Solves
Fixes an issue where later completed review results could remain unpublished when the oldest publication artifacts repeatedly failed to claim a publisher lease.
Current
mainadmits up to 24 exact publishers. When an unchanged publication lease expires, however, the item was returned topendingwithnextAttemptAt = now. Admission sorts ready work by original creation time, so the same oldest item could immediately consume the slot again. One repeatedly unclaimed artifact can starve later results when capacity is configured to one; 24 such artifacts can monopolize the production lane.Why This Change Was Made
Expired unchanged publications now use the queue's existing bounded exponential retry backoff before re-admission. Newer source revisions still become immediately eligible, ordinary review recovery remains immediate, and one-shot failed-shard recovery behavior is unchanged.
User Impact
Later completed reviews can reach their durable comments even when older publication dispatches repeatedly fail before claim. The change improves fairness without reducing the current 24-publication throughput limit.
Implementation
reclaimExpiredExactReviewLeasebefore clearing the expired tuple.exactReviewRetryDelayMs.409 lease_not_active.Code-path analysis
ExactReviewQueue.alarmindashboard/worker.tsreclaims expired leases, computes admitted items, and dispatches signedrepository_dispatchpayloads.reclaimExpiredExactReviewLeaseowns state transition from expireddispatching/leasedwork back topending.exactReviewQueueAdmittedItemsselects ready publications up toEXACT_REVIEW_PUBLICATION_MAX_CONCURRENT, ordered bycreatedAtand key.finishExactReviewQueueItemalready usesexactReviewRetryDelayMsfor failed attempts; this patch applies the same bounded policy to unclaimed publication expiry..github/workflows/sweep.ymlkeeps exact publication on currentmain, validates immutable producer artifacts, rejects stale tuples, and defers verdict routing through the target-serialized router. This PR does not change that workflow.test/dashboard-worker.test.tscovers publication capacity, legacy lease recovery, stale claims, and the new fairness behavior.Mainline comparison
openclaw/clawsweeper:main0a17516dd286800c2cca4d818b2a75255f4b5c70mainwhile validating immutable producer artifacts.Branch / base provenance
openclaw/clawsweeper:main@0a17516dd286800c2cca4d818b2a75255f4b5c70snowzlmbot/clawsweeper:fix/exact-review-publication-starvation@258c1279d0aa6a65a3edd59b58290d6e60138a19mainalready contains stronger replacements.Dependency / contract verification
Labels considered
bugimpact:othermerge-risk: availabilitymerge-risk: automationThese are contributor suggestions; no upstream metadata change is assumed.
Validation
GitHub-hosted validation:
258c1279d0aa6a65a3edd59b58290d6e60138a19— both affected queue tests passed, including the new fairness regression; Windows launcher and crawl-remote toolchain jobs passed. The aggregatepnpm checkjob reported only five established fork-context failures intest/failed-review-retry.test.tsbecause the fixture modelsopenclaw/clawsweeperwhileGITHUB_REPOSITORYnames the fork.6042fbd4b9ff7b8e53426c4417c1c5252cd8eab5— success;pnpm checkcompleted in 9m31s and the Windows launcher and crawl-remote toolchain jobs passed. The evidence branch differs from the PR head only by the historical public screenshot/report and a three-line proof-only test normalization ofGITHUB_REPOSITORY; all three PR-changed files are byte-identical.Local pre-submit checks were limited to static gates:
git diff --check— passed.oxfmt --checkfor all three changed files — passed.Evidence source map
[901, 902]while 901 enters backoff.Sanitized logs
Media evidence
No visual surface changes. The behavior is a deterministic Durable Object scheduling transition; the public Actions run and focused assertion provide the inspectable proof. No production mutation or private environment was used.
Risk
Rollback
Revert the single commit. No data migration, configuration migration, workflow change, or irreversible mutation is introduced. Existing queue rows remain compatible in either direction.
Docs updated
docs/limits.mdnow documents the publication-specific 15-minute claim window and bounded fairness backoff.Related issue / PR
Review context addressed
Not tested / limitations