You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Budget admission runs after the VM has already booted #120
Hyper.Node.try_run/3 (lib/hyper/node.ex) calls start_fun first and only then Budget.admit(spec, pid). When admission refuses, it calls stop_fun to tear the VM down again.
Impact
N concurrent CreateVm calls all claim a uid and NetId, set up a volume, netns and jail, and start Firecracker before most of them are refused. A caller can repeatedly push a node past its CPU, RAM and disk budget for the duration of a boot, and every refused VM costs a full launch plus teardown in the helper.
Fix
Reserve first: take the budget reservation before starting the VM, keyed by a placeholder, then transfer it to the VM pid once it is running (or release it if the start fails).
The Quint specs in #206 record this as an expected violation: placement_reliable violates runningWithinCapacity (the VMs running on a node exceed its hard budget until the loser is stopped), while admittedWithinCapacity holds. A counterexample in the model, not reproduced on a running system.
Two things beyond the cost described above, both from reading the code at e281a48:
docs/cookbook/architecture.md:210-211 says the hard budget is never to be exceeded.
If the process running try_run/3 dies between start_fun and admit (lib/hyper/node.ex:357-359), nothing stops the VM and it stays unreserved.
Activity
markovejnovic commentedon Nov 30, 2026
The Quint specs in #206 record this as an expected violation:
placement_reliableviolatesrunningWithinCapacity(the VMs running on a node exceed its hard budget until the loser is stopped), whileadmittedWithinCapacityholds. A counterexample in the model, not reproduced on a running system.Two things beyond the cost described above, both from reading the code at
e281a48:docs/cookbook/architecture.md:210-211says the hard budget is never to be exceeded.try_run/3dies betweenstart_funandadmit(lib/hyper/node.ex:357-359), nothing stops the VM and it stays unreserved.