chore: Export all functions used by server cmd (#7118)

* chore: Export all functions used by server cmd

Required to make workspace proxy cmd
* Factor out httpservers and tracer
This commit is contained in:
Steven Masley
2023-04-13 09:07:19 -05:00
committed by GitHub
parent 87fe16cde9
commit fa64c58e56
3 changed files with 242 additions and 192 deletions
+2 -2
View File
@@ -711,7 +711,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
return h.transport.RoundTrip(req)
}
// dumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
// DumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the
// stacktrace of all goroutines to stderr and a well-known file in the home
// directory. This is useful for debugging deadlock issues that may occur in
// production in workspaces, since the default Go runtime will only dump to
@@ -723,7 +723,7 @@ func (h *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// A SIGQUIT handler will not be registered if GOTRACEBACK=crash.
//
// On Windows this immediately returns.
func dumpHandler(ctx context.Context) {
func DumpHandler(ctx context.Context) {
if runtime.GOOS == "windows" {
// free up the goroutine since it'll be permanently blocked anyways
return