Skip to content

fix(httpd): treat forced shutdown as a successful stop#3029

Open
AllBeingsFuture wants to merge 1 commit into
AgentWrapper:mainfrom
AllBeingsFuture:ao/agent-orchestrator-24/fix-httpd-forced-shutdown
Open

fix(httpd): treat forced shutdown as a successful stop#3029
AllBeingsFuture wants to merge 1 commit into
AgentWrapper:mainfrom
AllBeingsFuture:ao/agent-orchestrator-24/fix-httpd-forced-shutdown

Conversation

@AllBeingsFuture

Copy link
Copy Markdown

Problem

When graceful http.Server.Shutdown times out (common with long-lived SSE streams), the daemon forced Close() and then returned an error. That made the process exit 1. Electron surfaced intentional stop/restart as "daemon start failed" (code: exited) even though the user/app asked to stop.

Solution

After shutdown timeout + forced close, log and return <-serveErr (normally nil after ErrServerClosed) instead of wrapping the timeout as a failure. Forced close is still an intentional, successful stop.

Tests

  • go test ./internal/httpd/ -count=1
  • Existing lifecycle / POST /shutdown tests still expect a nil Run error on intentional stop.

Notes

Independence

Can merge independently of the tmux and workspace product fixes.

After graceful Shutdown times out (common with long-lived SSE) and we
force Close, return serveErr instead of a shutdown error so the daemon
exits 0. Electron was reporting intentional stops as "daemon start failed".
@somewherelostt

Copy link
Copy Markdown
Collaborator

Thanks for contributing to Agent Orchestrator.

This PR is being picked up by the current external contributor on-call pair:

If someone is already working on this, please continue as usual.
The on-call pair is added for visibility, tracking, and support, not to take over the work.
If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @Pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here:
https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

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.

5 participants