go/src
Brad Fitzpatrick 427a444f67 net/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 #7010

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=adg, golang-codereviews, rsc
https://golang.org/cl/86740044
2014-04-11 09:40:36 -07:00
..
cmd cmd/gc: increase specificity of errors in function call context 2014-04-11 15:57:30 +02:00
lib9 lib9/utf: bring C environment up to Unicode 6.3.0 2014-02-25 17:49:32 -08:00
libbio libbio, libmach: warnings from the Plan 9 tool chain 2014-04-07 08:40:13 -07:00
liblink liblink: remove code that is never executed 2014-04-07 22:12:26 -07:00
libmach libbio, libmach: warnings from the Plan 9 tool chain 2014-04-07 08:40:13 -07:00
pkg net/http: quiet useless warning during shutdown 2014-04-11 09:40:36 -07:00
Make.dist
all.bash
all.bat
all.rc
clean.bash
clean.bat
clean.rc
make.bash cmd/go, cmd/cgo, make.bash: cross compiling with cgo enabled 2014-02-06 09:11:00 -08:00
make.bat
make.rc lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
race.bash
race.bat race.bat: set exit status 2013-12-17 15:09:42 +04:00
run.bash build: remove depdenency on GNU make 2014-04-07 11:34:35 +10:00
run.bat run.bash: explain why we set GOMAXPROCS for runtime test 2014-03-06 13:16:14 +04:00
run.rc run.bash: explain why we set GOMAXPROCS for runtime test 2014-03-06 13:16:14 +04:00
sudo.bash