Skip to content

fix(spurctld): remove dead code and wire leader-forwarding fallback#156

Merged
powderluv merged 1 commit intoROCm:mainfrom
shiv-tyagi:fix/spurctld-dead-code-cleanup
May 8, 2026
Merged

fix(spurctld): remove dead code and wire leader-forwarding fallback#156
powderluv merged 1 commit intoROCm:mainfrom
shiv-tyagi:fix/spurctld-dead-code-cleanup

Conversation

@shiv-tyagi
Copy link
Copy Markdown
Member

Remove unused complete_step (WAL path handles it), get_jobs_by_name_user (inline closure in pending_jobs covers it), and unused scheduler imports.

Fix leader-forwarding in server.rs: replace unconditional ? with match so the original "not leader" status (with leader-hint metadata) is returned when the proxy connection fails, and log the inner error via warn.

Remove unused `complete_step` (WAL path handles it), `get_jobs_by_name_user`
(inline closure in `pending_jobs` covers it), and unused scheduler imports.

Fix leader-forwarding in server.rs: replace unconditional `?` with match so
the original "not leader" status (with leader-hint metadata) is returned when
the proxy connection fails, and log the inner error via warn.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up unused controller/cluster code paths and adjusts gRPC leader-forwarding so that, when a follower can’t proxy to the leader, callers still receive the original “not leader” Status (including any leader-hint metadata) rather than a proxy-connection error.

Changes:

  • Updated several SlurmController RPC handlers to forward to the leader via an explicit match, logging proxy failures and returning the original not-leader status.
  • Removed dead ClusterManager APIs (complete_step, get_jobs_by_name_user) and eliminated now-unused scheduler imports.
  • Minor test cleanup to drop an unused import.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/spurctld/src/server.rs Adjusts leader-forwarding behavior to preserve the original not-leader Status when proxying fails, and logs the proxy error.
crates/spurctld/src/scheduler_loop.rs Removes an unused JobState import in tests.
crates/spurctld/src/cluster.rs Removes dead step/job-query helpers and unused scheduler imports; simplifies an unused local in cancel_job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/spurctld/src/server.rs
Comment thread crates/spurctld/src/server.rs
@powderluv powderluv merged commit c220cd8 into ROCm:main May 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants