server: treat a zero-capacity storage pool as full - #14052
Open
nagaboinaramgopal wants to merge 1 commit into
Open
server: treat a zero-capacity storage pool as full#14052nagaboinaramgopal wants to merge 1 commit into
nagaboinaramgopal wants to merge 1 commit into
Conversation
checkUsagedSpace divided used by total capacity without guarding a zero total. A pool reporting capacityBytes == 0 (freshly added, stats not yet populated) with zero used produced NaN, and NaN >= threshold is false, so the method returned true and reported that a pool with no capacity had space, letting allocation or resize proceed onto it. Return false when the pool reports no capacity.
DaanHoogland
approved these changes
Sep 4, 2026
DaanHoogland
left a comment
Contributor
There was a problem hiding this comment.
it is a long shot but a negative value may have been entered in the DB and coming back through a VO, so clgtm.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14052 +/- ##
============================================
- Coverage 19.78% 19.78% -0.01%
+ Complexity 19998 19996 -2
============================================
Files 6371 6371
Lines 575899 575901 +2
Branches 70495 70496 +1
============================================
- Hits 113967 113959 -8
- Misses 449501 449512 +11
+ Partials 12431 12430 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
checkUsagedSpace divided used by total capacity without guarding a zero total. A pool reporting capacityBytes == 0 with zero used produced NaN, and NaN >= threshold is false, so the method returned true and reported that a pool with no capacity had space, letting allocation or resize proceed onto it. Return false when the pool reports no capacity.
Tested: new unit test checkUsagedSpaceReturnsFalseForZeroCapacityPool (fails before, passes after); StorageManagerImplTest green.