net/http: don't read Request headers after ServeHTTP starts #14940
Comments
Can you run your server with the race detector (-race) enabled? It may give us a better idea of where this race is coming from. |
Yes,I can. |
Is your |
Is ok to write (*http.Request).Header map in the http.handler callback and in the http.Handler thread? |
I suppose net/http shouldn't read from Request.Header after ServeHTTP has been started. |
Thanks for help. I think I may found the reason of this crash. I will try to fix it and wait for crash for a week, and keep this issues open. |
Not a waste of time. We could change net/http to look at what it needs to in the request headers before starting the user's ServeHTTP func and be more robust against this in general. |
CL https://golang.org/cl/21530 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6 linux/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
This issues is happend on a product api server with qps about 100/s.
It will crash the process.
It generated a 2MB panic log,but
I may do something bad. but how can i found the bad thing?
What is the possible bad thing ?
The text was updated successfully, but these errors were encountered: