summaryrefslogtreecommitdiff
path: root/pkg/api/server/idle/tracker.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-05 22:51:03 +0200
committerGitHub <noreply@github.com>2020-10-05 22:51:03 +0200
commita0bf02684ecb76557cebb369011191525f066c7f (patch)
treedda662fd0725e2f07c5e948bcb3480517f65f699 /pkg/api/server/idle/tracker.go
parent1b16fcfd14b9e761849e53ac2b83c964ad8ac5a9 (diff)
parent2fc50f8b13de0c60072effa8a991bcf36da1fded (diff)
downloadpodman-a0bf02684ecb76557cebb369011191525f066c7f.tar.gz
podman-a0bf02684ecb76557cebb369011191525f066c7f.tar.bz2
podman-a0bf02684ecb76557cebb369011191525f066c7f.zip
Merge pull request #7904 from jwhonce/wip/idle
Fixes remote attach and exec to signal IdleTracker
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