[Pools] Fix incorrect worker resource-fit checks - #10596
Open
siyuzhou wants to merge 1 commit into
Open
Conversation
siyuzhou
force-pushed
the
fix/pool-resource-fit-numeric
branch
2 times, most recently
from
August 28, 2026 20:44
214c463 to
3f1b0d4
Compare
siyuzhou
force-pushed
the
fix/pool-resource-fit-numeric
branch
from
August 29, 2026 00:27
3f1b0d4 to
24e1277
Compare
siyuzhou
force-pushed
the
fix/pool-resource-fit-numeric
branch
from
August 29, 2026 00:34
24e1277 to
8596671
Compare
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.
Resources.cpus and absolute Resources.memory values are strings, so
_task_fits() compares them lexicographically. Parse them with the existing
resource arithmetic parser before checking capacity. Preserve memory-per-CPU
values such as 3x by resolving the multiplier against the task CPU request.
Reject non-finite parsed demand or capacity values so NaN cannot pass a fit
check.
Extend the existing unit test with multi-digit CPU and memory values, fitting
and non-fitting 3x cases, and non-finite CPU and memory demand and capacity.
These cover false rejection, false acceptance, and fail-closed validation.
Tested: