Repository navigation
Open
0 / 10 of 1 issue completedLabels
Description
Priority
Wave 1 — local lifecycle correctness. Live progress presentation is a separate #2831/#2859 workstream.
Problem
Local startup and shutdown do not share one bounded ownership boundary. Readiness can wait indefinitely, startup failure can bypass cleanup, shutdown uses per-process waits without one total deadline, and cancellation may be converted into an HTTP 500.
Essential scope
- Transactional
RunHelperacquisition: record each resource immediately and unwind everything acquired before startup failure. - Finite overall deadlines for head readiness, component readiness, configured endpoint readiness, cancellation cleanup, and shutdown.
- Idempotent shutdown.
- Start commands in process groups or another explicit descendant-ownership mechanism.
- Signal, wait, escalate, reap, and continue cleaning other components within one total shutdown budget.
- Re-raise
CancelledError,KeyboardInterrupt, andSystemExitafter bounded cleanup rather than converting them to ordinary HTTP failures. - Report unresolved remote cleanup when feat(core): define resources-session identity and close protocol #2609/feat(resources): add session TTL and lifecycle adoption #3037 data exists without claiming local process exit released it.
Moved or deferred scope
- Oldest active attempt, progress heartbeats, recent model/tool activity, and stalled-but-live presentation belong to feat: live visibility into in-progress rollouts #2859 under [epic] Rollout observability & reliability fast-follows #2831.
- Automatic restart and circuit breaking are out of scope.
- Remote session identity and close belong to feat(core): define resources-session identity and close protocol #2609/feat(resources): add session TTL and lifecycle adoption #3037.
Dependencies
No hard dependency for local correctness. #144 depends on the durable process ownership and shutdown API established here. #2859 later consumes stable progress and identity APIs without blocking this issue.
Acceptance criteria
- Fault injection after each startup stage releases every earlier acquisition.
- Every readiness stage has one finite overall deadline and identifies the failed component.
- Shutdown is idempotent and terminates owned descendants within one configured deadline.
- Cancellation propagates after bounded cleanup and is not converted to HTTP 500.
- Cleanup continues when one owned component does not exit.
- Remote cleanup remains a separately reported state when available.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDev Todo
Activity
[-]feat(core): own startup, shutdown, cancellation, and stall detection[/-][+]feat(core): own startup, shutdown, and cancellation[/+]fix(cli): bound Gym server startup wait (NVIDIA-NeMo#3735)
fix(cli): bound Gym server startup wait (#3735)
cwing-nvidia commentedon Nov 29, 2026
One case to include in this issue's scope: the servers keep running when the
gymprocess that started them ends without running its shutdown path.Reproduced at 66a0698 on macOS (Apple Silicon) and Ubuntu (x86-64), Python 3.13.14:
gym env start --resources-server mcqa --model-type openai_model, wait for "All 4 / 4 servers ready".gymprocess.gymprocessThe result was the same on both systems, and nothing was printed in the two failing cases. The servers kept their ports until each process group was ended by hand.
Where this comes up:
The scope above covers shutdown that the
gymprocess runs itself. In these cases it never runs, so a deadline or an idempotent shutdown does not help: the servers would need to notice that their parent is gone, or a later command would need to find and report them.A possible acceptance criterion: after SIGHUP or SIGKILL of the process that started the servers, no owned server process is still running once the shutdown deadline has passed.
Each server is started in its own session (
start_new_session=Trueinnemo_gym/server_runtime/supervisor/server_supervisor.py), and I found no code that ends a server when its parent exits.