Skip to content

Simplify graceful worker shutdown#71

Merged
t-kalinowski merged 1 commit into
mainfrom
simplify-graceful-shutdown
May 19, 2026
Merged

Simplify graceful worker shutdown#71
t-kalinowski merged 1 commit into
mainfrom
simplify-graceful-shutdown

Conversation

@t-kalinowski
Copy link
Copy Markdown
Member

Summary

This makes closing worker stdin the only graceful shutdown request for reset, respawn, and server shutdown. The change removes interpreter-specific shutdown snippets and sideband shutdown delivery so lifecycle behavior is simpler and avoids races between stdin and sideband.

User-Facing Changes

  • Reset and shutdown no longer send quit("no"), exit(), or custom shutdown text to worker stdin.
  • A user-level prompt such as R readline() or Python input() can no longer consume graceful shutdown text as ordinary input.
  • EOF-driven interpreter finalization remains best effort; existing timeout and OS termination escalation remains the fallback.

Internal Changes

  • Removes worker_ready.graceful_shutdown.stdin from the worker protocol and built-in R/Python worker-ready messages.
  • Removes the server-to-worker sideband shutdown command from graceful shutdown.
  • Updates reset/shutdown behavior to close stdin and wait through the existing escalation path.
  • Adds public regression coverage for custom Zod workers and Python input() during reset.
  • Records the direction as ADR 0001 and updates protocol docs.

Close worker stdin as the sole graceful shutdown request. Remove interpreter shutdown snippets from worker-ready advertising and drop the server-to-worker sideband shutdown command. Add regression coverage and ADR documentation for the simplified lifecycle contract.
@t-kalinowski t-kalinowski merged commit 55c7209 into main May 19, 2026
5 checks passed
@t-kalinowski t-kalinowski deleted the simplify-graceful-shutdown branch May 19, 2026 13:49
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