summaryrefslogtreecommitdiff
path: root/pkg/api/server/idle/tracker.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/server/idle/tracker.go')
-rw-r--r--pkg/api/server/idle/tracker.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/api/server/idle/tracker.go b/pkg/api/server/idle/tracker.go
index 1b378c492..50e41b7bf 100644
--- a/pkg/api/server/idle/tracker.go
+++ b/pkg/api/server/idle/tracker.go
@@ -61,10 +61,14 @@ func (t *Tracker) ConnState(conn net.Conn, state http.ConnState) {
oldActive := t.ActiveConnections()
// Either the server or a hijacking handler has closed the http connection to a client
- if _, found := t.managed[conn]; found {
- delete(t.managed, conn)
- } else {
+ if conn == nil {
t.hijacked-- // guarded by t.mux above
+ } else {
+ if _, found := t.managed[conn]; found {
+ delete(t.managed, conn)
+ } else {
+ logrus.Warnf("IdleTracker %p: StateClosed transition by un-managed connection", conn)
+ }
}
// Transitioned from any "active" connection to no connections