feat(server,ui): add graceful SIGTERM/SIGINT shutdown to both binaries #23

Merged
ashraf merged 1 commit from development_graceful_shutdown into main 2026-04-23 14:29:15 +00:00
Member

Summary

  • Both hero_livekit_server and hero_livekit_ui now handle SIGINT and SIGTERM for clean process shutdown
  • Socket files (rpc.sock and ui.sock) are removed on exit to prevent stale sockets
  • Uses tokio::select! over spawned server task + shutdown_signal() async fn
  • Server binary uses abort_handle pattern to safely cancel the OServer task

Closes #7

Changes

  • crates/hero_livekit_server/src/main.rs: Added shutdown_signal(), service_socket_path(), wrapped OServer in spawned task with tokio::select! + abort handle
  • crates/hero_livekit_ui/src/main.rs: Added shutdown_signal(), restructured main() to spawn accept loop + await signal + cleanup

Test Results

  • 34 passed, 0 failed, 4 ignored (doc-tests)
## Summary - Both `hero_livekit_server` and `hero_livekit_ui` now handle SIGINT and SIGTERM for clean process shutdown - Socket files (`rpc.sock` and `ui.sock`) are removed on exit to prevent stale sockets - Uses `tokio::select!` over spawned server task + `shutdown_signal()` async fn - Server binary uses `abort_handle` pattern to safely cancel the OServer task ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_livekit/issues/7 ## Changes - `crates/hero_livekit_server/src/main.rs`: Added `shutdown_signal()`, `service_socket_path()`, wrapped OServer in spawned task with `tokio::select!` + abort handle - `crates/hero_livekit_ui/src/main.rs`: Added `shutdown_signal()`, restructured `main()` to spawn accept loop + await signal + cleanup ## Test Results - 34 passed, 0 failed, 4 ignored (doc-tests)
feat(server,ui): add graceful SIGTERM/SIGINT shutdown to both binaries
All checks were successful
Build & Test / check (push) Successful in 4m28s
Build & Test / check (pull_request) Successful in 4m21s
33d3b5475a
#7
ashraf merged commit 6192d33159 into main 2026-04-23 14:29:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_livekit!23
No description provided.