Skip to content

Enforce per-node allocation limit when finding available nodes - #1357

Closed
KroZen-Dev wants to merge 52 commits into
Ctrlpanel-gg:mainfrom
KroZen-Dev:fix/allocation-limit-per-node
Closed

Enforce per-node allocation limit when finding available nodes#1357
KroZen-Dev wants to merge 52 commits into
Ctrlpanel-gg:mainfrom
KroZen-Dev:fix/allocation-limit-per-node

Conversation

@KroZen-Dev

Copy link
Copy Markdown
Contributor

Description

Enforce the per-node allocation limit when selecting an available node for
server provisioning. Previously, findAvailableNode() only rejected nodes
that lacked resources or had no free allocations, and
findAvailableNodeWithAllocation() only checked resources — neither checked
whether 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, the
node is rejected before any free-allocation lookup, making node selection more
accurate and avoiding wasted calls.

Type of Change

  • Bug fix

Testing

  • Verified findAvailableNode() rejects a node once its per-node allocation
    limit is reached.
  • Verified findAvailableNodeWithAllocation() skips nodes at their allocation
    limit and falls through to the next available node.
  • Confirmed existing resource and free-allocation checks still behave as before.

Checklist

  • My PR targets the development branch
  • Commit messages follow Conventional Commits
  • Code follows PSR-12
  • I have reviewed my own code
  • I have tested all affected functionality
  • No new warnings or errors introduced

MrWeez and others added 30 commits April 24, 2026 15:38
…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>
MrWeez and others added 22 commits May 1, 2026 20:55
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.
@KroZen-Dev KroZen-Dev closed this Jul 12, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants