Replace orchestrator pools with a single takeover RPC - #489
Closed
hermabr wants to merge 1 commit into
Closed
Conversation
A new run started with FURU_REPLACE_ORCHESTRATOR inherits a live run's Slurm workers instead of re-queueing them. The successor prepares its snapshot, venv, and worker config up front (the same work a cold start needs), then sends the old coordinator one /takeover request carrying its coordinates — one offer per Slurm backend. The old run does all the local work itself: it matches offers to its pools by fingerprint, rewrites the matched endpoint files, signals its running workers with SIGUSR1, and only then answers and shuts down. The successor never touches another run's files or Slurm jobs, which is also the shape a future multi-cluster setup needs, where only the old side has filesystem and scancel access to its cluster. Workers stay redirectable because their sbatch scripts resolve the coordinator URL, auth token, project, and config through a per-pool endpoint file at runtime; a worker that disconnects re-reads the file and re-execs into the new project when the generation grew. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Minimal rework of the orchestrator-takeover design (supersedes the two-message inventory/claim version). A new run started with
FURU_REPLACE_ORCHESTRATORinherits a live run's Slurm workers instead of re-queueing them.Design: one RPC, each side does its own local work
The successor prepares its snapshot, venv, and worker config before connecting — that's the same work a cold start needs, so nothing is wasted if the takeover matches nothing. It then sends one
/takeoverrequest: its coordinates, one offer per Slurm backend. The old coordinator does everything local to it:scancel --signal=USR1,The successor never touches another run's files or Slurm jobs. Besides being smaller (two wire models instead of six, no mid-handshake state where the successor holds half-finished writes into someone else's directory, no separate "drop before claim" path), this is the division of labor a multi-cluster future needs: only the side that owns a cluster has filesystem and
scancelaccess to it, so "redirect yourself to me" is the message shape that survives, even though nothing multi-cluster is built here.Worker-side machinery is unchanged from the previous design: sbatch scripts resolve the coordinator URL, token, project, and config through a per-pool endpoint file at runtime, and a disconnected worker re-reads the file and re-execs when the generation grew. The filesystem live-run registry remains as a dumb discovery pointer (
{url, token}).Failure behavior
Note:
tests/test_furu_locking_contention.py::test_lock_is_taken_over_mid_createis flaky on slow filesystems (0.5s spawn deadline) — it fails identically on unmodifiedmainon my machine and is unrelated.🤖 Generated with Claude Code