[Fixed] Profiling and Monitoring timeout issues

The http servers for those two were recently modified to set
a ReadTimeout and WriteTimeout. The WriteTimeout specifically
caused issues for Profiling since it is common to ask sampling
of several seconds. Pprof code would reject the request if it
detected that http server's WriteTimeout was more than sampling
in request.
For monitoring, any situation that would cause the monitoring code
to take more than 2 seconds to gather information (could be due
to locking, amount of objects to return, time required for sorting,
etc..) would also cause cURL to return empty response or WebBrowser
to fail to display the page.

Resolves #600
This commit is contained in:
Ivan Kozlovic
2017-11-08 14:52:27 -07:00
parent 92c4481d1b
commit 22cff99e58
4 changed files with 83 additions and 22 deletions

View File

@@ -71,7 +71,7 @@ func runMonitorServerNoHTTPPort() *server.Server {
}
func resetPreviousHTTPConnections() {
http.DefaultTransport = &http.Transport{}
http.DefaultTransport.(*http.Transport).CloseIdleConnections()
}
// Make sure that we do not run the http server for monitoring unless asked.