Skip to content

Queue and cancel Builds on one Machine #807

Closed

Description

@nick-potts

Parent

Build runner spec (#798)

What to build

Let concurrent clients wait for the selected Machine's single active Build slot without uploading source early or creating durable jobs. This extends the remote attempt already implemented; it is not a cluster queue or a Deploy scheduler.

Acceptance criteria

  • Replace the remote slice's temporary busy refusal with one active Build and an in-memory FIFO of eight waiting Builds by default. Configure queue capacity, ten-minute queue timeout and thirty-minute active timeout through Machine-local policy, validating values at the input seam. A full queue rejects immediately and cannot be enlarged by a request.
  • Keep each waiting client's capture and secrets on the client and signal admission before upload. Measure queue waiting separately from admitted execution, which includes upload/preparation/build/import/cleanup. Hold one slot across every solve of a multi-platform Build without making the queue depend on recipe-specific code.
  • Remove a queued request on cancellation, disconnect or queue timeout. Active cancellation, observed disconnect or execution timeout requests bounded termination and cleanup; no downstream image publication or Deploy continues. If termination cannot be confirmed, report unknown and keep conflicting builder/cache ownership unavailable until safe.
  • On daemon restart, discard the in-memory queue and fail waiting commands; never replay work or mark interrupted work successful. Handle owned abandoned resources through bounded lifecycle cleanup before unsafe reuse. Cleanup does not become a background build-recovery workflow.
  • Show selected Machine, queue waiting versus execution, full/expired/cancelled/unknown outcomes, and completed versus unattempted work through the existing build progress/result interface. Add no public queue-management handshake, status polling, database, leases, automatic retries, or queue resource to the Cluster model.
  • Use rung-1 policy tests with controlled time for FIFO order, bounds, expiry, disconnect and unreleased ownership after unknown termination. Use rung-2/3 transport/CLI checks for upload-after-admission and outcome rendering. Register a rung-4 multi-client exercise covering queued disconnect, active cancellation, upload timeout, daemon restart, and a subsequent safe build.

Blocked by

Activity

  1. added a commit that references this issue on Sep 30, 2026
    cf0273e
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

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions