We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version go1.21.4 linux/amd64
go env
$ go env
GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/senan/.cache/go-build' GOENV='/home/senan/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/senan/.local/share/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/senan/.local/share/go' GOPRIVATE='' GOPROXY='direct' GOROOT='/usr/lib/go' GOSUMDB='off' GOTMPDIR='' GOTOOLCHAIN='local+path' GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.4' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1962473061=/tmp/go-build -gno-record-gcc-switches'
curling the following program with
curl "http://localhost:8080/debug/pprof/profile?seconds=10"
(10 seconds being longer than the 1 second global WriteTimeout, but before than the deadline set by SetWriteDeadline)
https://go.dev/play/p/zWTDhWFutKP
package main import ( "fmt" "net/http" "net/http/pprof" "time" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/debug/pprof/profile", func(w http.ResponseWriter, r *http.Request) { rc := http.NewResponseController(w) rc.SetWriteDeadline(time.Time{}) // no deadline pprof.Profile(w, r) }) server := http.Server{ Addr: ":8080", WriteTimeout: 1 * time.Second, // 1 second timeout Handler: mux, } fmt.Println(server.ListenAndServe()) }
the request succeeds
HTTP 400 with "profile duration exceeds server's WriteTimeout"
this makes it hard to expose custom pprof handlers with global server write timeouts
The text was updated successfully, but these errors were encountered:
Duplicate of #62358
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Go version
go version go1.21.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?$ go env
What did you do?
curling the following program with
curl "http://localhost:8080/debug/pprof/profile?seconds=10"
(10 seconds being longer than the 1 second global WriteTimeout, but before than the deadline set by SetWriteDeadline)
https://go.dev/play/p/zWTDhWFutKP
What did you expect to see?
the request succeeds
What did you see instead?
HTTP 400 with "profile duration exceeds server's WriteTimeout"
this makes it hard to expose custom pprof handlers with global server write timeouts
The text was updated successfully, but these errors were encountered: