Skip to content

Fix stop/restart hanging when ECA server is unresponsive#20

Draft
afucher wants to merge 1 commit intomainfrom
af/robust-stop
Draft

Fix stop/restart hanging when ECA server is unresponsive#20
afucher wants to merge 1 commit intomainfrom
af/robust-stop

Conversation

@afucher
Copy link
Copy Markdown
Contributor

@afucher afucher commented Mar 25, 2026

The stop() method awaited a shutdown JSON-RPC request with no timeout and never forcefully killed the child process. When ECA was stuck (e.g. during MCP initialization retries with 401 errors), stop() would hang forever, leaving the user unable to stop or restart from the UI.

  • Add timeout (5s) on the graceful shutdown request
  • Add killProcess() with SIGTERM → SIGKILL escalation
  • Always clean up process/connection refs and update status in finally
  • Guard against missing connection (stuck in Starting state)

🤖 Generated with eca

The stop() method awaited a shutdown JSON-RPC request with no timeout
and never forcefully killed the child process. When ECA was stuck
(e.g. during MCP initialization retries with 401 errors), stop() would
hang forever, leaving the user unable to stop or restart from the UI.

- Add timeout (5s) on the graceful shutdown request
- Add killProcess() with SIGTERM → SIGKILL escalation
- Always clean up process/connection refs and update status in finally
- Guard against missing connection (stuck in Starting state)

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca <noreply@eca.dev>
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