Skip to content
New issue

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

net/http/pprof: return error when requested profile duration exceeds WriteTimeout #18755

Closed
vcabbage opened this issue Jan 23, 2017 · 4 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@vcabbage
Copy link
Member

What version of Go are you using (go version)?

go version go1.8rc2 darwin/amd64


As observed in #18746, if a profile duration >= to the server's WriteTimeout is requested, the request will always fail with an EOF once the WriteTimeout elapses. Handlers which accept a duration parameters should check the WriteTimeout and return an error before starting the profile.

(A handler can retrieve the server which started it from the request's context.)

@vcabbage vcabbage added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 23, 2017
@vcabbage vcabbage added this to the Go1.9 milestone Jan 23, 2017
@bradfitz
Copy link
Contributor

I suppose we could've just reused that other bug, but this one is nice & succinct, so this works too.

/cc @ardan-bkennedy

@gopherbot
Copy link

CL https://golang.org/cl/35564 mentions this issue.

@ibrasho
Copy link
Contributor

ibrasho commented Jan 24, 2017

Will updating the handler to return a server error be enough?
The pprof tool will still need to be updated if we want it to print a clear error message. Otherwise, it'll just prints server response: 500. Is it safe to print the response body in addition to the HTTP status code?

@vcabbage
Copy link
Member Author

@ibrasho I'm working on it in the CL linked above. It does modify go tool pprof to print the body under limited circumstances.

@golang golang locked and limited conversation to collaborators Feb 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants