Skip to content

Slots gate: clear holds used up after a failed store read; fewer repeated warnings #574

Closed

Description

@scuttletoby

Follow-up from the review of #573 (#573 (comment)). Neither point blocks #573.

  1. A hold used up after a failed store read stays in the store file (apps/server/src/slots/SlotGate.ts, near line 250). The next good read hides it only in memory; stored.used is never called for it. After a server restart it counts again until it runs out, so the gate counts one agent too many for a while. Fix: return those keys and clear them through clearStored outside the semaphore, as acquire already does. Add a test: start while the store is unreadable, then a good read, then a new gate on the same store file: the hold is not counted.
  2. Repeated warnings while the store cannot be read (SlotGate.ts, near line 257). Every gate call and every observation logs a warning. Log only when the reason changes, as WaitService.unavailable does.

State question for the fix: runs again (clearing twice is harmless), stopped half-way (cleared in memory but not on disk), old or empty store file.

Activity

  1. added 2 commits that reference this issue on Nov 21, 2026
    a691886
    624b4ab
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions