Descriptionnet/http: quiet useless warning during shutdown
What was happening on Issue 7010 was handler intentionally took 30
milliseconds and the proxy's client timeout was 35 milliseconds. Then it
slammed the proxy with a bunch of requests.
Sometimes the server would be too slow to respond in its 5 millisecond
window and the client code would cancel the request, force-closing the
persistConn. If this came at the right time, the server's reply was
already in flight, and one of the goroutines would report:
Unsolicited response received on idle HTTP channel starting with "H"; err=<nil>
... rightfully scaring the user.
But the error was already handled and returned to the user, and this
connection knows it's been shut down. So look at the closed flag after
acquiring the same mutex guarding another field we were checking, and
don't complain if it's a known shutdown.
Also move closed down below the mutex which guards it.
Fixes Issue 7010
Patch Set 1 #Patch Set 2 : diff -r f5ef7ec5b144 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r f5ef7ec5b144 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 4 : diff -r 68f19a123155 https://go.googlecode.com/hg/ #MessagesTotal messages: 3
|