ShutdownWithContext doc incorrectly claims that any operation to the Server is unavailable on error
Author: hazyhaarCreated Sep 24, 2026Updated Sep 24, 2026
Summary
ShutdownWithContext documents that a returned error makes any further operation on the Server unavailable:
"When ShutdownWithContext returns errors, any operation to the Server is unavailable."
However, the implementation and TestShutdownWithContextTimeoutThenShutdownAgain do the opposite:
On context expiry, the method returns ctx.Err(), stop is cleared, active connections keep running, and Serve may be called again on a new listener. done stays closed so in-flight requests do not observe a new Done channel.
Proposed Fix
Clarify the godoc to reflect the tested contract: context expiration does not freeze or invalidate the Server struct.
A Pull Request updating the godoc is submitted concurrently.
Source: valyala/fasthttp