Skip to content

Scheduler: remaining unbounded waits around a scheduled fire (follow-up to #2955) #2959

Open

Description

@peppescg

Follow-up to #2955. #2958 bounds placement, session creation, the in-flight record writes and the engine save after a cancelled read batch. Together with #2631 (origin-session notices), that covers the causes we reproduced for #2588.

The points below harden the scheduler against rarer failures. None of them is needed for the stall reported in #2588, unless that incident turns out to come from a run that ignores cancellation. We asked for logs on #2631.

Points

  • A fire whose own run ignores cancellation. The dispatcher waits for every tool call with no timeout (engine/agent/dispatch.go:476-479). Local Shell is bounded: SIGKILL to the process group and a 5s WaitDelay. Still to verify:

    • remote runners (microVM, execution client);
    • MCP SDK cancellation;
    • foreground Subagent/Parallel/Team trees.

    Priority depends on the Scheduler: hung schedule fire never reaped past Deadline; Singleton schedule stalls #2588 logs.

  • Test with a real provider adapter. A run cancelled at its deadline ends, and the fire releases its lease within a bounded time. The code already suggests this: the resilience layer stops on cancellation. This item turns it into a test.

  • Store calls under the name fence in the stale-fire reconciler and the one-shot re-arm (internal/app/scheduler_reconcile.go, reArmOneShot) have no timeout.

    • The reconciler retries every tick, so a bound there should be safe.
    • Check the re-arm against TestBlockedRearmLoadDoesNotBlockDueAdmission first.
    • This is not the terminal RecordFire in fireClaimed, which stays unbounded on purpose: on a lease-backed scheduler, a pending claim that loses its settlement is quarantined.
  • The fire's terminal session settle and its event-log appends (settleFireTerminalSnapshot → Persist, and the run event recorder) have no timeout when the session store or the event log hangs. This needs a decision first:

    • a timed-out settle can leave a finished fire's session running;
    • bounding the event appends can drop durable events.
  • A metric or alert for quarantined fire capacity, so that operators see stuck fires before every slot is taken.

Activity

  1. added
    bug
    on Nov 23, 2026
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

    bugkubernetes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions