GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(fleet): daily top-issue dispatch jobs race on shared state — same issue double-dispatched (2026-11-04: #5421) · Issue #5464 · developing-today/code

fix(fleet): daily top-issue dispatch jobs race on shared state — same issue double-dispatched (2026-11-04: #5421) #5464

New issue
Copy link
New issue
Copy link
Closed
Closed
fix(fleet): daily top-issue dispatch jobs race on shared state — same issue double-dispatched (2026-11-04: #5421)#5464
Copy link
Assignees
dezren39
Labels
effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 4, 2026
Issue body actions

Problem

The two daily top-issue dispatch jobs — opencode-daily-top-issue (rotating) and opencode-daily-top-issue-code (code-dedicated) — both fire at 07:12 and share opencode-top-issue-state.json as their dedupe record. The state file is read-then-written with no atomic claim step, so when both runs select concurrently they cannot see each other.

On 2026-11-04 both jobs walked the code backlog to #5421 and launched OpenCode sessions ~22 seconds apart (sessions ses_e5e594cc7dbffeQhm3TWhSNM38 / task 9531 / tracking #5458, and ses_e5e594c5081ffeAPNQmQjGx2sC / task 9533 / tracking #5461). The later session was stood down manually (deleted via the OpenCode server API) and #5461 closed; a queue lane (task 9434, from triage 9432) was also already working the same issue, so three channels converged on one small fix.

Why it matters

Double-booking is exactly what the shared state file exists to prevent (the feeder's dedupe rule was written after the opencode#831 / queue-task-3137 double-booking). Duplicate sessions burn laptop build capacity, produce competing PRs for the same issue, and need manual cleanup.

Fix directions (any one, or combined)

  • Claim before dispatch: at selection time, atomically mark the issue (e.g. apply queue/claimed via gh and re-read to confirm this run won) before calling pm-dispatch; the loser walks to the next backlog entry.
  • Stagger the two jobs so the code-dedicated job runs after the rotating job has written state (and have the rotating job skip code on days the sibling owns it, or vice versa).
  • Have each job re-read the state file (and the issue's labels) immediately before the dispatch call, not only at run start.

Acceptance

  • A repeat of the 2026-11-04 morning (both jobs firing the same minute with the same top backlog entry) results in exactly one dispatch; the other job records a dedupe skip.
  • The dedupe check covers queue-lane claims too: an issue with a live queue fix task is not dispatched.

Acceptance criteria

  • Two dispatch jobs racing on the same state cannot dispatch the same issue twice
  • The claim on shared state is atomic or lock-guarded, with the losing job standing down visibly
  • A test or scripted repro demonstrates the race is closed

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    status/needs-triageNot yet triaged; needs a first look
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    developing-todayBot
    on Nov 4, 2026 – with developing.today
    Contributor
    More actions

    CODE-1327

  3. dezren39
    added
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    Intake review

    • Related issues/PRs: merged PRs with this issue number in the title: none found in a merged-PR title search. No merged PR explicitly resolves this issue, so it stays open.
    • Notes: Enriched by the fleet monitor (Duty 2, protocol §5): acceptance criteria appended to the body, labels normalized (kind/bug, priority/high, effort/m).
    • Risks / suggested approach: This is the same double-work class the queue claim exists to prevent: the dispatch jobs need an atomic claim (or single-writer lock) over their shared state file. Risk: a lock that can wedge dispatch entirely — needs a stale-lock escape.
  5. github-actions
    assigned
    dezren39
    on Nov 4, 2026
  6. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  7. 3 remaining items

  8. dezren39
    added
    queue/queuedHas a queued queue task
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Task 10044 triage complete: issue #5464 confirmed open and un-fixed, fix scoped, implementation enqueued as task 10562. Findings: #5464 (comment)

  10. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  11. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Picked up by repo queue worker lane code-c as task 10562 (small_fix). Implementing the claim-before-dispatch fix scoped in the task 10044 triage: stagger the two daily dispatch jobs, add an atomic claim step before pm-dispatch, and a scripted two-run race drill.

  12. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Fixed — task 10562 (lane code-c, 2026-11-05)

    All three scoped items from the task 10044 triage are implemented and verified:

    1. Stagger: opencode-daily-top-issue-code now fires at 07:32 America/Chicago (was 07:12, same minute as the rotating sibling). The rotating opencode-daily-top-issue stays at 07:12. Verified by read-back: live job next run Fri 2026-11-06 07:32 CST, and the regenerated repo copy matches the prepared body byte-for-byte.
    2. Claim-before-dispatch (both job bodies): after selection, a dispatcher must atomically mkdir a per-issue claim dir (hidden_files/opencode-top-issue-claims/<owner>-<repo>-<n>.claim) and write claimant.json — exactly one concurrent run can win a mkdir. The winner then SETS queue/claimed + work/assigned on the issue (both jobs previously only read these labels) and re-reads claim + labels; immediately before the pm-dispatch POST it re-reads the shared state file and labels again. The loser records a visible verdict=dedupe-skip line in sweep.log and walks to the next backlog entry. Queue-lane claims count as claims (skip, never dispatch). Stale escape: a claim older than 2h with no dispatched state entry may be removed and retried once, so a dead claim cannot wedge dispatch.
    3. Race drill: hidden_files/dispatch-claim-fix-5464/opencode-dispatch-claim-drill.py — 8 concurrent claimants on the same issue produced exactly 1 winner / 1 dispatch and 7 dedupe skips; a pre-existing queue-lane claim also made the dispatcher dedupe-skip. Drill passes.

    Prepared bodies + drill are kept in the goal workspace at hidden_files/dispatch-claim-fix-5464/; both live job bodies were applied via cron.update from that exact text (repo-copy-first house rule) and verified by projection match.

    Closing as fixed: a repeat of the 2026-11-04 morning now yields exactly one dispatch, with the losing job's dedupe skip on record.

  13. dezren39
    closed this as completedon Nov 5, 2026
  14. developing-today
    added
    status:done
    on Nov 5, 2026
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.