#480
[Bug]: API server does not gracefully shut down on termination
Problem
The API HTTP server is started in a goroutine, but shutdown needs to explicitly stop and wait for the listener before telemetry and shared database resources are cleaned up. Unexpected server failures must also produce a non-zero exit without bypassing deferred cleanup.
Expected behavior
- On a termination signal, stop accepting new HTTP requests and allow in-flight requests to finish within a bounded deadline.
- Force-close remaining connections if graceful shutdown times out, and report shutdown/close errors.
- Drain telemetry after the HTTP server has stopped.
- On an unexpected serve failure, clean up resources and exit non-zero.
This issue tracks the behavior addressed by PR #476.
Activity
0No activity yet.