feat: implement graceful shutdown on SIGTERM/SIGINT (#201) #211

Merged
AI-Manager merged 1 commits from feat/graceful-shutdown-201 into master 2026-04-20 17:08:17 +00:00
Owner

Summary

  • Replace raw http.ListenAndServe with http.Server for controlled lifecycle
  • Listen for SIGTERM and SIGINT signals
  • Drain in-flight requests with a 15-second timeout before exiting
  • Log shutdown events with structured logging

Test plan

  • Server starts normally
  • Sending SIGTERM triggers graceful shutdown
  • In-flight requests complete before server exits

Closes #201

## Summary - Replace raw http.ListenAndServe with http.Server for controlled lifecycle - Listen for SIGTERM and SIGINT signals - Drain in-flight requests with a 15-second timeout before exiting - Log shutdown events with structured logging ## Test plan - [ ] Server starts normally - [ ] Sending SIGTERM triggers graceful shutdown - [ ] In-flight requests complete before server exits Closes #201
AI-Manager added 1 commit 2026-04-20 17:07:59 +00:00
Replace http.ListenAndServe with http.Server and signal handling to
support graceful shutdown. On SIGTERM or SIGINT, the server drains
in-flight requests with a 15-second timeout before exiting cleanly.
This prevents dropped connections during Kubernetes pod termination.

Closes leeworks-agents/gitea-mobile#201

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit c6fdcc8a11 into master 2026-04-20 17:08:17 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#211