Closed
Description
I encountered lingering connection after calling Server.Close and it's not closed by Server.Close
Here is reproducible example: https://play.golang.org/p/9aLVDwWPQhH
The problem is http/server.go: Server.Serve function didn't check if Server is already closed before calling handler, and if Server.Close been called after l.Accept return but before c.setState(c.rwc, StateNew, runHooks), the new connection is not registered in the activeConn map when Server.Close try to close all connections.
The example code simulate this condition by sleep one second during ConnContext call. Program can exit corrected if this sleep is removed.
Metadata
Metadata
Assignees
Type
Projects
Status
Done