braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
999 stars 103 forks source link

Allow /debug endpoints be access while service shutting down #36

Open viblo opened 8 years ago

viblo commented 8 years ago

Sometimes if the service is left hanging waiting for shutdown you want to access the /debug endpoints provided by some packages, such as the one you get by importing /net/http/pprof

Any idea on how to handle such a scenario? Ideally I wouldnt want to assign two port to all my go services.

viblo commented 8 years ago

In case someone is reading this issue: I settled on exposing the http.DefaultServeMux as a unix domain socket as a work around. I used this code as a inspiration https://github.com/betfair/opentsp/blob/master/internal/pprof/pprof_unix.go