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 — mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released · Issue #6897 · developing-today/code

mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897

New issue
Copy link
New issue
Copy link
Closed
#7041
Closed
mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released#6897
#7041
Copy link
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Finding

When a task's cooperative cancellation grace period expires, expireCancellation() records the task as Cancelled — but it never closes the task's done channel, so a caller blocked in Store.Result() is not released by the expiry. Result() waiters are only released when the underlying work eventually returns (the worker goroutine closes done), which is exactly what does not happen for the uncooperative work the grace mechanism exists for.

Evidence

  • Source PR: mcpx: give tasks honest cancellation and error endings (#2499) #3699 (merged, merge 687ac07a84d9ed9cf737473de52f9419ee348927, head f8470369c2e8342c07ab262aff4bdf6a0918eb31) — it introduced the cancel-grace timer and expireCancellation().
  • pkgs/mcpx/internal/tasks/tasks.go on current main (4cd2927643453bee47a0f764de534e229220cf88, verified twice via the contents API):
    • expireCancellation at line 1208 sets t.Status = Cancelled, arms retention, saves, and calls s.changed(...) — no close(t.done) anywhere in the function.
    • Result at line 1261 blocks on case <-t.done: (line ~1269); it returns the "task was cancelled" fault only after done closes.
    • The only close(t.done) calls are line 457 (load-time reconstruction of already-terminal rows) and line 904 (the worker goroutine, after fn(ctx) returns).
    • The code itself states the contract at line ~1198: "a watcher may wait on the task's completion (Store.Result waits for done)".
  • mcpx: give tasks honest cancellation and error endings (#2499) #3699's grace-expiry test does not catch this: it releases the work before calling Result(), so done is closed by the worker path, not by the expiry path.

Why it matters

The grace expiry is the terminal guarantee for work that ignores cancellation: Get() reports Cancelled and retention starts, yet any client waiting in Result() hangs until its own context expires. The task's recorded state and its wait semantics disagree, on precisely the path designed for uncooperative work.

Acceptance criteria

  • When expireCancellation records Cancelled, waiters in Result() are released promptly and observe the cancelled fault, without the work returning.
  • done is closed at most once across all terminal paths (worker finish, immediate cancel, grace expiry, load reconstruction) — no double-close panic under -race.
  • A regression test covers grace expiry while the work never returns: Result() unblocks with the cancelled fault.
  • Existing tasks tests still pass (go test ./internal/tasks/, race included via CI).

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/pr-diff-reviewFiled by the pr-diff-review job
    priority/normalOrdinary priority (the default)
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

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

    CODE-2158

  3. dezren39
    added
    queue/queuedHas a queued queue task
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 7, 2026
  4. developing-today commented on Nov 8, 2026

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

    Agent note - picked up

    • Agent: queue worker (repo-worker-code), lane code-k
    • Session / ID: task 11296
    • Found via: queue claim
    • Task: Triaging issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897 (mcpx tasks grace expiry never closes done). Next: verify expireCancellation/Result against fresh main on the laptop, reproduce, and route (fix follow-up or direct fix per scope).
    • Links: issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897
  5. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 8, 2026
  6. 1 remaining item

  7. developing-today commented on Nov 8, 2026

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

    Agent note - parked

    • Agent: queue worker (repo-worker-code), lane code-k
    • Session / ID: task 11296
    • Found via: queue claim
    • Task: Parked task 11296 (issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897) for 1200s on CI/Codex for PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041. Triage verified on fresh main 9bb7f19 (expireCancellation records Cancelled, no close(t.done)); regression test reproduced the hang (Result waiter context deadline), fix implemented: mu-guarded once-only closeDone, grace expiry closes done, worker close is once-only, CancelImmediate unchanged. Commit 45bf2d8. Tests: go test ./internal/tasks/ -race full package PASS, go vet clean.
    • Expectation: on resume, check PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 checks + Codex findings, merge, then complete task 11296.
    • Links: issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897, PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 mcpx(tasks): close done on grace expiry so Result waiters are released #7041
  8. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 8, 2026
  9. developing-today commented on Nov 8, 2026

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

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane code-q
    • Session / ID: task 11296
    • Found via: queue claim (direct execution lane), resuming from checkpoint "checks + Codex on PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041, then merge and complete"
    • Task: Triage/fix for issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897 (mcpx tasks: grace expiry records Cancelled but never closes done). PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 is OPEN on branch queue/11296-6897-grace-expiry-done, head 45bf2d8; diff matches intent (pkgs/mcpx/internal/tasks/tasks.go +30/-2, tasks_test.go +35). Codex: no review or findings posted on PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 as of 2026-11-08T02:44Z — nothing undispositioned. CI has not completed: the three basic checks (scripts-test 3.12/3.14, proxy port fallbacks) have been QUEUED since 2026-11-08T01:54Z with no runner pickup (CodeRabbit skipped/completed) — the same runner stall as PR ci(check-workflows): validate node runs.main and composite step shapes #7020, not a failure of this change.
    • Expectation: task 11296 parked 20 minutes per the CI rule; on resume, if checks are green and no Codex findings have appeared, merge PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041, close issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897, and complete task 11296.
    • Links: issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897, PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041
  10. dezren39
    added 2 commits that reference this issue on Nov 8, 2026

    mcpx(tasks): close done on grace expiry so Result waiters are released (

    d040e28

    mcpx(tasks): close done on grace expiry so Result waiters are released (

    4fe0262
  11. dezren39
    closed this as completedin #7041on Nov 8, 2026
  12. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 8, 2026
  13. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  14. dezren39 commented on Nov 9, 2026

    @dezren39
    dezren39
    on Nov 9, 2026
    MemberAuthor
    More actions

    Agent note — lane code-w, task 11296

    • Stage: done (already_done) — verified fresh 2026-11-09: issue mcpx(tasks): grace expiry records Cancelled but never closes done — Result() waiters are not released #6897 CLOSED 2026-11-08T16:12:34Z; PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 MERGED 2026-11-08T16:12:32Z, merge commit 4fe0262
    • Prior progress (awaiting_ci, branch queue/11296-6897-grace-expiry-done) named the remaining step as merge-then-complete; the merge already happened, so this lane completes task 11296 as already_done with that evidence — no new work, no competing PR
    • Note: PR mcpx(tasks): close done on grace expiry so Result waiters are released #7041 check rollup shows some FAILURE/CANCELLED entries alongside SUCCESS entries; the merge was performed by the prior lane under the fleet's main-only CI policy
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

    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus: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.