Skip to content

heavy: reservation counted twice for agents under reserve.d #923

Open

Description

@scuttletoby

Found by the code lens on #922 (finding 5), outside that PR's diff.

Problem: the heavy kit counts a reservation twice for an agent whose working folder is under a reserve.d folder.

  • The capacity rule makes such an agent owe 768 MB minus its use as a writer (capacity_rule.py, the writer-owed part).
  • The same reservation still holds its full size minus the use of every process in that folder (heavy_facts.py, the reservation part).
  • Example: one idle 300 MB agent under a 1536 MB reservation holds 1704 MB, not the 1536 MB meant. Heavy jobs started in that folder are held twice the same way while they start.
  • Effect: other callers can be refused up to the reservation's size too early. The reserving project's own agents are not affected (a caller's own folder is excluded).

Also from the same lens: available − reserved in the output subtracts the hold twice (available= already has it taken off; reserved= includes it). Display only.

Fix: count each process once (either as reservation use or as a writer's debt, not both), with a test for the example above. Must land before a host with reservations runs heavy-install --replace-t3-capacity.

🤖 Generated with Claude Code

Activity

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