Hugo server shutdown behavior for active preview connections
0 reputation · 19 Feb 2023, 00:35 UTC
Goal
Determine whether Hugo's built-in preview server drains active HTTP connections during shutdown or closes them immediately when the process receives an interrupt signal.
Constraints and uncertainty
Hugo's documented hugo server options do not include read, write, or idle timeout settings, and no graceful-shutdown flag is listed. Shutdown behavior may depend on the Go standard library version embedded in the compiled binary and can differ between Hugo releases. Long-running live-reload connections may therefore be reset without warning during deployment or local stops.
Questions
- Does Hugo drain in-flight preview connections before exiting, or terminate them immediately on SIGINT?
- Are server connection timeouts configurable through any documented Hugo flag or environment variable?
- Should connection draining and timeout enforcement be handled entirely by an upstream proxy or process manager?