diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-04-09 11:05:18 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-04-13 08:11:36 -0700 |
commit | f8892e7c6b07cb77979199cf0474ac2af80829fd (patch) | |
tree | 8a46fa46124460e7e8602b8d518b184837df01aa /pkg/api/server/handler_api.go | |
parent | 309a7f7d1bbd046b4bd1a961a7e8c5313aa11b8e (diff) | |
download | podman-f8892e7c6b07cb77979199cf0474ac2af80829fd.tar.gz podman-f8892e7c6b07cb77979199cf0474ac2af80829fd.tar.bz2 podman-f8892e7c6b07cb77979199cf0474ac2af80829fd.zip |
Refactor service idle support
* Move connection tracking into APIServer using ConnState()
* Remove Connection counters from CLI code
* Update events handler to support client not closing connection
* Improve logging messages
Fixes #5599
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/server/handler_api.go')
-rw-r--r-- | pkg/api/server/handler_api.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go index 30a1680c9..7a7db12f3 100644 --- a/pkg/api/server/handler_api.go +++ b/pkg/api/server/handler_api.go @@ -19,7 +19,7 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { if err != nil { buf := make([]byte, 1<<20) n := runtime.Stack(buf, true) - log.Warnf("Recovering from podman handler panic: %v, %s", err, buf[:n]) + log.Warnf("Recovering from API handler panic: %v, %s", err, buf[:n]) // Try to inform client things went south... won't work if handler already started writing response body utils.InternalServerError(w, fmt.Errorf("%v", err)) } @@ -27,12 +27,7 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { // Wrapper to hide some boiler plate fn := func(w http.ResponseWriter, r *http.Request) { - // Connection counting, ugh. Needed to support the sliding window for idle checking. - s.ConnectionCh <- EnterHandler - defer func() { s.ConnectionCh <- ExitHandler }() - - log.Debugf("APIHandler -- Method: %s URL: %s (conn %d/%d)", - r.Method, r.URL.String(), s.ActiveConnections, s.TotalConnections) + log.Debugf("APIHandler -- Method: %s URL: %s", r.Method, r.URL.String()) if err := r.ParseForm(); err != nil { log.Infof("Failed Request: unable to parse form: %q", err) |