Enforce per-node allocation limit when finding available nodes - #1357
Closed
KroZen-Dev wants to merge 52 commits into
Closed
Enforce per-node allocation limit when finding available nodes#1357KroZen-Dev wants to merge 52 commits into
KroZen-Dev wants to merge 52 commits into
Conversation
…ions only on initial creation Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…but still keep filtering in the api usercontroller.php Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…party dependencies
Ensure nodes that have reached their per-node allocation limit are excluded before attempting to assign a free allocation, preventing selection of nodes that cannot host new servers.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Enforce the per-node allocation limit when selecting an available node for
server provisioning. Previously,
findAvailableNode()only rejected nodesthat lacked resources or had no free allocations, and
findAvailableNodeWithAllocation()only checked resources — neither checkedwhether a node had already reached its per-node allocation limit. As a result,
nodes at their allocation limit could still be treated as available and only
fail later when trying to grab an allocation.
This adds an early guard in both methods: if
nodeHasReachedAllocationLimit($node, $node->allocation_limit)is true, thenode is rejected before any free-allocation lookup, making node selection more
accurate and avoiding wasted calls.
Type of Change
Testing
findAvailableNode()rejects a node once its per-node allocationlimit is reached.
findAvailableNodeWithAllocation()skips nodes at their allocationlimit and falls through to the next available node.
Checklist
developmentbranch