• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 18786402642

24 Oct 2025 04:49PM UTC coverage: 47.271% (+0.1%) from 47.142%
18786402642

push

github

web-flow
fix: prevent zombie supervisor processes on restart (#2306)

Fixes #2274

When running 'thv restart' on an already-running workload, the command
would return early with 'Container is already running' but would NOT
stop the old supervisor process. This caused supervisor processes to
accumulate over time.

Changes:
- restartContainerWorkload now always stops supervisor + container when
  workload is already running
- restartRemoteWorkload applies the same logic for remote workloads
- Handles edge cases: dead supervisor, dead container, or both

The fix ensures restart always performs a proper stop→start cycle:
1. Stops old supervisor (kills proxy process)
2. Stops container if running
3. Cleans up client configurations
4. Starts fresh supervisor + container

System is resilient - stopProcess gracefully handles missing PIDs,
and supervisor auto-exits when container dies.

Added comprehensive unit tests and E2E test to verify no process
accumulation occurs on multiple restarts.

52 of 73 new or added lines in 1 file covered. (71.23%)

19 existing lines in 3 files now uncovered.

18883 of 39946 relevant lines covered (47.27%)

15.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.62
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc