Skip to content

fix(uninstall): stop managed services before removing the tooling that stops them (EAI-8014) - #299

Open
fredespi wants to merge 1 commit into
mainfrom
rocm-uninstall-reports-success-while-leaving-a
Open

fix(uninstall): stop managed services before removing the tooling that stops them (EAI-8014)#299
fredespi wants to merge 1 commit into
mainfrom
rocm-uninstall-reports-success-while-leaving-a

Conversation

@fredespi

Copy link
Copy Markdown
Collaborator

Summary

rocm uninstall reported uninstall complete (RC=0) while a managed model server was still running — including a publicly-bound, GPU-holding vLLM endpoint — and then deleted the rocm/rocmd binaries and service records needed to stop it. The supported rocm services stop path was gone, leaving only a manual PID kill to release the GPU.

This change stops managed services before removing anything, and refuses to proceed if it cannot.

Changes

  • apps/rocm/src/uninstall.rs: after the confirmation gate and before removing any path, stop every live managed service. If any cannot be confirmed stopped, abort with a non-zero exit and remove nothing — so the tooling needed to recover (rocm services stop) stays in place. The error names the offending services and how to stop them. On success, report how many were stopped, then proceed with removal.
  • apps/rocm/src/main.rs: new stop_managed_services_before_uninstall() returning a ManagedServiceStopReport { stopped, failed }. It reuses the existing verified process-tree termination path (stop_internal_managed_service / terminate_recorded_service_pids) that rocm services stop already uses, so a service is only counted stopped once every recorded process is confirmed gone; a service that merely crashed (not live) is skipped and does not block uninstall.
  • Updated the uninstall plan warning from "background processes are not stopped automatically in this pass" to "their servers will be stopped before removal".

Test plan

  • New unit tests (apps/rocm):
    • uninstall_stops_live_managed_service_and_reports_it — a live managed server is stopped and reported before uninstall proceeds.
    • uninstall_skips_already_dead_managed_service — a crashed (non-live) service neither counts as stopped nor aborts uninstall.
  • cargo clippy -p rocm --all-targets -- -D warnings clean; cargo test -p rocm passes (verified in a Linux container).
  • Matches the behavior pinned by the uninstall-stops-what-it-manages scenario in the README-walkthrough contract PR (test(e2e): pin the contracts a README walkthrough expects (EAI-8024) #241): "the server is no longer running" after the managed files are removed.

@fredespi
fredespi requested a review from a team as a code owner August 22, 2026 12:09
@fredespi
fredespi requested a review from r0x0r August 22, 2026 12:09
…t stops them (EAI-8014)

`rocm uninstall` reported completion while a managed model server — including
a publicly-bound, GPU-holding vLLM endpoint — kept running, then deleted the
binaries and service records needed to stop it, leaving only a manual PID kill.

Stop every live managed service before removing anything. If any cannot be
confirmed stopped, abort non-zero and remove nothing so the recovery tooling
stays in place. Reuses the verified process-tree termination path used by
`rocm services stop`.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
@fredespi
fredespi force-pushed the rocm-uninstall-reports-success-while-leaving-a branch from d1e9c4e to 0bebf62 Compare August 22, 2026 14:18
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