Skip to content

feat(cli): add bounded graceful server shutdown #144

Description

@cwing-nvidia

Priority

Wave 3 — user-facing lifecycle control. Implement after #3160 establishes durable local ownership and a bounded shutdown API.

Problem

Users need a supported way to stop Gym services without tracking terminals or killing individual PIDs. The command must consume #3160 rather than create a second process-discovery and termination path.

Essential scope

  • Stop all locally owned services or a selected service.
  • Use feat(core): own startup, shutdown, and cancellation #3160's one graceful deadline and explicit force escalation.
  • Report graceful, timed-out, force-terminated, already-stopped, and unresolved-remote-cleanup results.
  • Make repeated stop safe.
  • Document graceful versus forced local shutdown and the limits of remote cleanup.

Dependencies

Hard dependency on #3160's durable process ownership and shutdown API. Remote release state is consumed when #2609/#3037 provides it but does not block the local command.

Acceptance criteria

  • Users can stop all services or one selected service through gym env.
  • Graceful shutdown uses one overall deadline.
  • Force escalation is explicit and never the first default action.
  • Repeating stop is safe when services are already stopped.
  • Local exit and unresolved remote cleanup are reported separately.

Activity

  1. added this to the v0.1.0 milestone on Oct 13, 2025
  2. removed this from the v0.1.0 milestone on Oct 23, 2025
  3. linked a pull request that will close this issuefeat: graceful server shutdown commands #353on Nov 19, 2025
  4. changed the title [-]Add CLI command to gracefully shutdown running servers[/-] [+]feat: CLI command to gracefully shutdown running servers[/+] on Apr 10, 2026
  5. changed the title [-]feat: CLI command to gracefully shutdown running servers[/-] [+]feat(cli): add bounded graceful server shutdown[/+] on Sep 9, 2026
  6. cwing-nvidia commented on Sep 19, 2026

    @cwing-nvidia
    ContributorAuthor

    Other user reported friction related to shutdown

    Shutdown exceeded the grace period. On Ctrl-C the three child services did not stop within Gym's one-second window and were killed; Ray then printed expected GCS-disconnected messages and a second interrupt was needed. Cosmetically alarming at the end of an otherwise clean run.

    @ananthsub could we also work this into this ticket or track as a separate item?

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

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions