8f41a003b0eece7d3cf21a43621dd402f6e89903
The per-write deadline that severs a stalled SSE reader was never cleared on return. Server.WriteTimeout is deliberately unset -- a WriteTimeout would sever a healthy long-lived stream -- and with it unset net/http never resets the connection write deadline between keep-alive requests. So the deadline the last writeChunk left set leaks onto the next request that reuses the pooled connection and fails its first write for no reason. Clear it to the zero value on return via a deferred rc.SetWriteDeadline; best-effort, a no-op on writers without deadline support. Also record honestly at the header flush that the connect-time stall stays bounded only by the per-principal stream cap, not severed by this guard -- only the mid-stream stall is closed. Adds a test pinning the clear (fails closed: neutering the deferred clear leaves a +writeTimeout deadline set on return).
Languages
Go
62.7%
TypeScript
22.5%
Shell
7.4%
Java
7.1%
Dockerfile
0.2%
Other
0.1%