Skip to content

Wake a READY session's quiesced actor on ResumeSession - #23

Merged
oldsj merged 1 commit into
mainloop-substrate-0-4from
quiesced-wake
Oct 10, 2026
Merged

oldsj merged 1 commit into
mainloop-substrate-0-4from
quiesced-wake

Conversation

@oldsj

@oldsj oldsj commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What changed

ResumeSession on a READY session whose actor idle quiescence suspended or paused now wakes that same actor. It runs as a fenced RESUME lifecycle operation: same generation, actor UID and context, with the existing verifyActor checks. It refuses a changed UID, a revoked generation, live dispatch, an active turn, pending quiescence or a transitional actor. An uncertain outcome keeps the operation pending, and a retry reconciles it. GetSession stays read-only, and there's no proto change.

Proven / not proven

  • Proven offline: session, database and migrations tests pass with -race against real PostgreSQL and faked actors. Independent review accepted the change.
  • Not proven live: a Substrate ResumeActor call on a real suspended actor.
  • Known follow-up: a wake that isn't followed by a turn doesn't re-queue idle quiescence.

Idle quiescence suspends or pauses a Session's actor but keeps the Session
READY/NONE. GetSession then has no running runtime association, and
ResumeSession was a no-op for READY, so a caller that must attest the
exact running actor before dispatch had no supported way to wake it.

ResumeSession on a READY Session now observes the current generation's
actor. A running actor needs no work. A suspended or paused one gets a
fenced RESUME operation on the same generation and actor UID, admitted
under the Session lock. The operation closes dispatch, idle work,
checkpoints and other lifecycle work until it finishes, and an uncertain
attempt stays pending for a retry to reconcile. Activation never changes
Session, context or generation identity and never creates compute. It is
refused for a changed actor, a revoked generation, an active turn or
dispatch, pending idle work, or an actor in a transitional state.
GetSession stays observational.

Signed-off-by: James Olds <12104969+oldsj@users.noreply.github.com>
@oldsj
oldsj merged commit 711eb56 into mainloop-substrate-0-4 Oct 10, 2026
3 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.

1 participant