scheduler: fix panic in system jobs when nodes filtered by class #11565
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.
Fixes #11563
In the system scheduler, if a subset of clients are filtered by class,
we hit a code path where the
AllocMetric
has been copied, but theCopy
method does not instantiate the various maps. This leads to anassignment to a nil map. This changeset ensures that the maps are
non-nil before continuing.
The
Copy
method relies on functions in thehelper
package that allreturn nil slices or maps when passed zero-length inputs. This
changeset to fix the panic bug intentionally defers updating those
functions because it'll have potential impact on memory usage. See
#11564 for more details.
This impacts 1.2.0 and above, so there's no backport required.