Skip to content

fix(spur-cli): show ReqNodeNotAvail reason when -w/-x makes job unschedulable #379

Description

@shiv-tyagi

Problem

When a job specifies -w <node> targeting a non-existent or unavailable node (or -x excludes all candidates), the pending reason shown in squeue is (Priority). Slurm shows (ReqNodeNotAvail, May be reserved for other job) or similar, which tells the user exactly why the job is stuck.

Confirmed on testbed

$ spur sbatch -w nonexistent-node job.sh
Submitted batch job 14
$ spur squeue
 JOBID      STATE     NODELIST(REASON)
    14    PENDING           (Priority)

Slurm would show (ReqNodeNotAvail...).

Proposed approach

The scheduler (or the controller's job-state tracking) needs to distinguish "no suitable nodes exist given constraints" from "nodes exist but are busy". When find_suitable_nodes() returns empty and a nodelist/exclude constraint is set, the pending reason should be set to ReqNodeNotAvail rather than the generic Priority.

Acceptance criteria

  • squeue shows (ReqNodeNotAvail) when -w targets unavailable/non-existent nodes
  • squeue shows (ReqNodeNotAvail) when -x excludes all candidates
  • Regular pending jobs without -w/-x still show (Priority) or other appropriate reasons

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions