Skip to content

fix: don't record an empty node name in NodeVmsWithLocalSnapshots - #399

Closed
Grant McCloskey (MushuEE) wants to merge 1 commit into
agent-substrate:mainfrom
MushuEE:fix/pause-empty-node-locality
Closed

Grant McCloskey (MushuEE) wants to merge 1 commit into
agent-substrate:mainfrom
MushuEE:fix/pause-empty-node-locality

Conversation

@MushuEE

Copy link
Copy Markdown
Collaborator

Fixes #397

When FinalizePausedStep runs after the assigned worker record has already been deleted, the node holding the local checkpoint is unknown and the step wrote NodeVmsWithLocalSnapshots: [""]. findFreeWorker treats any non-empty restriction list as a hard node filter, and no worker has an empty node name — so every subsequent resume of the affected actor fails with no free workers available, permanently, unless the caller discards state with boot=true.

Two guards:

  • Write side (FinalizePausedStep): only record the node name when it is known. An empty list means "no locality restriction", which keeps the actor schedulable — local checkpoints live on the node itself, so a shuffled retry can still land on the node that holds the data.
  • Read side (findFreeWorker): ignore empty entries in the restriction list, healing actor records already poisoned by the old write path without a data migration.

Includes unit tests for findFreeWorker's restriction handling (none existed). Existing pause/resume functional tests pass unchanged — the normal path (node known) still records the single-element list.

When FinalizePausedStep runs after the worker record is already gone,
the node holding the local checkpoint is unknown. Previously the step
wrote [""] into NodeVmsWithLocalSnapshots, which findFreeWorker treats
as a hard restriction no worker can satisfy - every subsequent resume
fails with 'no free workers available' and the actor is permanently
unschedulable short of boot=true.

Write side: only record the node when it is known; an empty list means
no locality restriction, so the scheduler can still place the actor
(local checkpoints live on the node, so a shuffled retry can land on
the node that holds it).

Read side: findFreeWorker ignores empty entries in the restriction
list, healing actor records already poisoned by the old write path
without a data migration.

Fixes agent-substrate#397
@EItanya

Copy link
Copy Markdown
Collaborator

This PR has been closed due to inactivity. If you believe this to be a mistake feel free to re-open with a comment explaining why this PR is still relevant and a maintainer will revisit it, thanks so much

Comment left by Claude on behalf of Eitan Yarmush (@EItanya).

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

Labels

area/api-machinery area/scheduling kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pause finalization can record an empty node name in NodeVmsWithLocalSnapshots, leaving the actor permanently unschedulable

3 participants