Skip to content

An unrecognized --node-scheduler-policy or --gpu-scheduler-policy is silently obeyed as the opposite policy #2995

Description

@badnikhil

What happened:

Both flags are plain StringVars (cmd/scheduler/main.go:70-71), and IsValidNodeSchedulerPolicy / IsValidGPUSchedulerPolicy are only reached from the annotation path (score.go:155, util.go:352). Downstream each value hits a whole-string comparison with an unconditional else (NodeScoreList.Less, DeviceUsageList.Less), so an unrecognized value is not ignored, it selects the other policy. Nothing is logged.

Placing one small pod on two nodes, empty and half-reserved loaded:

--node-scheduler-policy="spread"  -> empty
--node-scheduler-policy="Spread"  -> loaded
--node-scheduler-policy="spraed"  -> loaded

Sorting one idle and one busy GPU the way Fit walks the list from the tail:

--gpu-scheduler-policy="binpack" -> [busy idle]
--gpu-scheduler-policy="binpak"  -> [idle busy]

What you expected to happen:

The scheduler refuses to start, the way #2769 refuses to act on an unrecognized annotation. The chart interpolates both values straight onto the command line (templates/scheduler/deployment.yaml:121-122) and there is no values.schema.json, so the flag is the only place left to catch this.

How to reproduce it (as minimally and precisely as possible):

Set scheduler.defaultSchedulerPolicy.nodeSchedulerPolicy: Spread in values.yaml. The scheduler binpacks.

Environment:

  • HAMi version: master (b5ec6b1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions