Feat: release stopped server capacity#8
Merged
Conversation
…edule A stopped server used to keep its full slot: the host runtime counted its CPU/memory toward capacity, and the scheduler kept its reservation, so a stopped server tied up resources it was not using and was pinned to its original host. Free that capacity and let a stopped server reschedule onto any host when it next starts: - Host runtime no longer counts non-running VMs (checkCapacity/fitsLocked); Start re-checks capacity since a resumed VM's slot may have been taken. - New `evict` op across the agent contract (Runtime -> firecracker/fake -> link -> hub -> Commander -> RemoteProvisioner -> Provisioner). Firecracker's Deprovision and Evict share teardown(deleteWorld): Evict drops the host-local VM + disk but keeps the durable world snapshot; Deprovision also deletes it. - reconciler.stop: snapshot world -> evict VM -> scheduler.Release -> mark stopped. MarkStopped now clears host_id, so UsedCapacity stops counting the server and its next start re-runs placement (world restored from the durable store, keyed by server id). Tradeoff: on a host with world persistence but no durable store, the world is host-local, so a reschedule to a different host starts from an empty world. Documented inline; capacity is freed on stop regardless.
TestGameServerLifecycle asserted the running server's port was exactly 25565, which only holds when it is the first VM on the shared suite host. The fake runtime hands out the lowest free host port at or above the standard Minecraft port, so when other tests' VMs hold the low ports this server gets the next one up (e.g. 25570) and the assertion flakes depending on suite ordering. Assert it is a valid pool port (>= 25565) instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.