Skip to content

The warm pool retries a shutdown on a refused platform's device every 30 s #389

Closed

Description

@V3RON

What happened

The warm pool acts on devices of a platform whose driver was refused at discovery. A ready record of that platform is proposed for shutdown on every pass, catalog.get throws, and a warning is logged every 30 s. The failed device's slot already went back into the pool's room, so the next least-recently-used device is never picked, and a global over-budget stays over.

What you expected

The pool skips devices of a refused platform, as the startup converger does (src/core/startup-converger.ts:161).

How to reproduce

From code review of PR #386 (the warm pool, #368): src/core/warm-pool/converger.ts:171. Not reproduced.

Environment

Branch task/368 (PR #386), not yet on main.

Logs and evidence

Reviewer's claim, not verified.

Written by an agent.

Activity

  1. added
    bug:new
    on Oct 6, 2026
  2. added and removed
    bug:new
    on Oct 17, 2026
  3. self-assigned this
    on Oct 17, 2026
  4. V3RON commented on Oct 17, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Defect — confirmed on main (58bba816), LRU starvation and stuck over-budget included.

    bug/389-repro, create-core.test.ts: "leaves a device of a platform with no driver out of the shutdown choice, shutting down the next least recently used device and coming back under budget".

    pnpm exec vitest run --project unit src/core/create-core.test.ts -t "no driver"
    AssertionError: expected [] to deeply equal [ 'fake-ios-1' ]   (create-core.test.ts:671)
    

    iOS driver only, fixed capacity at maxRunning: 1, two idle ready devices (android LRU, iOS
    next), three passes past the pause. Today, before the expectation was flipped:

    warn "warm pool shutdown of a device failed" deviceId=dev_1 step=shutdown
         error="NoDriverError: No driver registered for platform: android"
    failureLineCount: 4   iosShutdownCalls: []   both devices still "ready"   overLimit: true
    

    A throwaway filter turned all five assertions green: it fails for the right reason.

    Root cause

    converger.ts:443 builds the view unfiltered and WarmPoolOptions has no driver port, so the pool
    cannot know a platform is gone. policy.ts:261-264 releases the LRU victim's slot before the act,
    leaving the pass no second victim once that shutdown is doomed; #logFailure (converger.ts:650)
    pauses it one tick, and the tick re-proposes it. StartupConverger skips these
    (startup-converger.ts:84). Target resolution refuses only boots, not shutdowns. All three shutdown
    reasons share this path.

    Simplest fix

    A hasDriver(platform) option, wired at create-core.ts:236 from drivers.select(platform).length > 0,
    applied in #view() to drop those devices from the candidates; capacityDevices(all) still counts them.

    Alternatives rejected

    • Catching at #act: still spins a doomed device every tick; the pass spent its victim.
    • Quarantining it: a refused platform is not the device's fault; "unreadable is not gone".
    • StartupRead: one-time, and calls a timed-out listing unreadable.

    Risk

    • It must stay in the capacity totals, or the pool sees a free slot and over-subscribes.
    • It is hidden from boot proposals too — intended, but check status.
    • targeted() (converger.ts:202) stays unfiltered; decide whether it should.

    Side findings

    Written by an agent.

  5. removed their assignment
    on Oct 17, 2026
  6. added
    bug:ready
    and removed on Oct 17, 2026
  7. self-assigned this
    on Oct 17, 2026
  8. V3RON commented on Oct 17, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #661 (#389)

    Written by an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions