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 — fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park · Issue #6420 · developing-today/code

fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420

New issue
Copy link
New issue
Copy link
Closed
#8425
Closed
fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park#6420
#8425
Copy link
Labels
app/fleetpkgs/fleet multicall binary + platform crateseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park

Evidence (verified this run, origin/main a2b4345e80927cb1d8ac652756cb219b971bf635)

None of the three duration flags is range-validated at any layer — client, broker, or SQL:

  • Client — pkgs/fleet/crates/fleet-queue/src/client.rs: parse_i64_flag (:579) accepts any i64 (the fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 fix made non-numeric values a loud error, but range was never checked), and the three call sites send the parsed value verbatim:
    • cmd_claim (:906, :912): "lease_seconds": args.get_i64("lease-seconds").unwrap_or(2700)
    • cmd_heartbeat (:982, :994): "extend_seconds": args.get_i64("extend-seconds").unwrap_or(900)
    • cmd_park (:1021, :1054): "delay_seconds": args.get_i64("delay-seconds")
  • Broker — pkgs/fleet/crates/fleet-queue/src/queue_broker.rs: /claim (:382-390) copies lease_seconds into p_lease_seconds, /heartbeat (:412-420) copies extend_seconds into p_extend_seconds, and /park (:432-445) copies delay_seconds into p_delay_seconds — all verbatim, no range check.
  • SQL — pm-stack/opencode-claimant/migration-0023.sql: claim_repo_task (:235) takes p_lease_seconds integer and sets lease_until = now() + make_interval(secs => p_lease_seconds) (:271) with no guard; park_task (:150) computes v_not_before := now() + make_interval(secs => coalesce(p_delay_seconds, 1200)) (:165) the same way. Both parameters are integer (int4), so an i64-scale value from the client also overflows at the RPC boundary.

Verified on the laptop with the real repo-queue binary (laptop primary build; the lease/extend/delay code paths are byte-identical HEAD..origin/main — the HEAD..origin client.rs diff touches none of them) against a recording stub broker (probe ~/git/fleet/probe-queue-lease, REPO_QUEUE_BROKER_URL direct transport):

invocation recorded broker body exit
claim --lease-seconds 0 "lease_seconds":0 0
claim --lease-seconds -5 "lease_seconds":-5 0
claim --lease-seconds 999999999999 "lease_seconds":999999999999 0
claim --lease-seconds 2700 (control) "lease_seconds":2700 0
claim --lease-seconds abc (control, #5939) — rejected: argument --lease-seconds: invalid int value "abc" 2
heartbeat 42 --extend-seconds 0 "extend_seconds":0 0
heartbeat 42 --extend-seconds -60 "extend_seconds":-60 0
heartbeat 42 --extend-seconds 900 (control) "extend_seconds":900 0
park 42 --delay-seconds 0 "delay_seconds":0 0
park 42 --delay-seconds -3600 "delay_seconds":-3600 0
park 42 --delay-seconds 1200 (control) "delay_seconds":1200 0

Consequences, by value:

  • Claim lease 0 / negative → lease_until is now() or in the past: the claim succeeds but is born expired, so the task is immediately reclaimable by another worker while the first holder works it — the double-work failure the atomic claim exists to prevent.
  • Claim lease huge (e.g. 999999999999, ~31,700 years as i64 seconds) → either overflows the SQL integer parameter (a downstream RPC error instead of a usage error naming the flag) or, where it fits, pins the task for effectively ever if the holder dies.
  • Heartbeat extend 0 / negative → the holder instantly lapses its own claim mid-work: its follow-up verbs fail and the task becomes reclaimable under it — the claim-evaporation pattern, self-inflicted by a typo'd flag.
  • Park delay negative → not_before lands in the past: the "parked" task is immediately claimable, silently defeating gate waits (e.g. a park waiting on a prerequisite issue). Delay 0 is at best a requeue-now that should be a deliberate verb, not a park.

Relation to #6419

#6419 covers the sibling list --limit range gap; its triage packet explicitly scoped this class out with an audit item — "sibling get_i64 flags (--lease-seconds, --extend-seconds, --delay-seconds): validated downstream or needs the same treatment". This issue is that audit's answer: they are not validated downstream (client, broker, and SQL evidence above), and the failure modes here are worse than a misreported list — they corrupt claim/lease/park state rather than just a read.

Why it matters

Every fleet lane drives the queue through these three verbs. The values are one typo or one bad script variable away (--lease-seconds $EMPTY_OR_ZERO), the failure is silent (exit 0, normal-looking output), and the resulting states — born-expired claims, self-lapsed heartbeats, un-parked parks — are exactly the divergence classes the fleet monitor then has to reconcile. A usage error naming the flag at the client, plus a broker-side guard (the broker is the trust boundary for non-CLI callers), closes the whole class.

Acceptance criteria

  • repo-queue claim --lease-seconds 0 and negative values are rejected with a usage error naming --lease-seconds (exit 2), consistent with the fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 non-numeric rejection; a documented sane maximum is enforced the same way.
  • repo-queue heartbeat --extend-seconds 0 and negative values are rejected likewise (naming --extend-seconds); the absent-flag defaults (claim 2700, heartbeat 900) behave exactly as before.
  • repo-queue park --delay-seconds negative values are rejected (naming --delay-seconds); the semantics of 0 are decided explicitly (reject, or documented immediate-requeue) and pinned by a test.
  • The broker rejects out-of-range lease_seconds / extend_seconds / delay_seconds before the RPC call, so non-CLI callers get the same guard.
  • Tests pin 0, -1, the maximum, maximum+1, and the defaults for all three flags; the fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 non-numeric rejection still passes.

Activity

Next
  1. developing-today commented on Nov 6, 2026

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

    CODE-1922

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/fleetpkgs/fleet multicall binary + platform crates
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-11-05 20:05 CST (2026-11-06T02:05Z)
    • Found via: filed this run
    • Task: Filed after verifying on the laptop that repo-queue's duration flags (--lease-seconds / --extend-seconds / --delay-seconds) accept 0, negative, and unbounded values at client, broker, and SQL layers — probe ~/git/fleet/probe-queue-lease (real repo-queue binary + recording stub broker); this is the downstream-validation audit answer for the sibling-flag item in issue fleet(queue): repo-queue list --limit accepts 0, negative, and unbounded values — 0 silently reports '(no tasks)', and the broker forwards the value verbatim to PostgREST #6419's triage packet.
    • Expectation: effort s — triage decides the validation layer(s) and bounds; acceptance criteria are in the issue body.
    • Links: probe ~/git/fleet/probe-queue-lease (laptop); sibling issue fleet(queue): repo-queue list --limit accepts 0, negative, and unbounded values — 0 silently reports '(no tasks)', and the broker forwards the value verbatim to PostgREST #6419
  4. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  5. 60 remaining items

  6. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 11, 2026
  7. developing-today
    added
    status:in-review
    on Nov 11, 2026
  8. dezren39
    added 3 commits that reference this issue on Nov 11, 2026

    fleet(queue): reject present-but-non-i64 duration values at the broker (

    909a7c4

    fleet(queue): run duration guards before backend selection — Turso co…

    b06959f

    Merge pull request #8425 from developing-today/queue/14436-6420-durat…

    af65ece
  9. dezren39
    closed this as completedin #8425on Nov 11, 2026
  10. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 11, 2026
  11. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — lane code-k (repo-worker-code), task 14436 (small_fix): PR #8425 merged (af65ece); issue #6420 closed. The three duration flags are now range-validated at the client (usage error exit 2 naming the flag; lease/extend 1..=86400, park delay 1..=604800, delay-0 rejected by explicit decision — a zero-wait park is a requeue) and at the broker before the RPC, with the guard also running ahead of backend selection in dispatch so the Turso backend is covered. Codex found two real holes across two review rounds (present-but-non-i64 values silently defaulting; the Turso dispatch bypass) — both fixed, replied, and resolved; the final head's review completed with no findings. Tests: cargo test -p fleet-queue --all-features 186 passed / 0 failed; CLI probe confirms every bad value from the issue's table now exits 2 naming its flag, and the #5939 non-numeric rejection is unchanged.

  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
  13. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    agent-note:v1

    • Agent: repo-worker-code, OpenChamber lane 1a180ae5-384f-4e71-8d77-08f7b1652c75
    • State: done
    • Task: Completed stale triage task 10858 after confirming triage already produced fix task 14436 and issue fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420 was closed by merged PR fleet(queue): validate duration flags at client and broker (#6420) #8425. No duplicate work created.
    • Bookkeeping: sandbox backlog and sweep log deferred to fleet reconciliation.
  14. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    Agent note — already done (task 14846, lane code-v)

    • Fresh revalidation 2026-11-11T03:32Z: issue fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420 is CLOSED (status:done) and the fix already landed — PR fleet(queue): validate duration flags at client and broker (#6420) #8425 "fleet(queue): validate duration flags at client and broker (fleet(queue): repo-queue duration flags (--lease-seconds, --extend-seconds, --delay-seconds) accept 0, negative, and unbounded values — a 0/negative lease is born expired, a negative park delay defeats the park #6420)" MERGED 2026-11-11T02:25:38Z, merge commit af65ece.
    • Task 14846 completes as already_done with that evidence; no duplicate work started.
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/fleetpkgs/fleet multicall binary + platform crateseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    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.