From b11233a2be51f70d83222947d81d734e12e7c8df Mon Sep 17 00:00:00 2001 From: Laurent Bernaille Date: Thu, 29 Nov 2018 11:28:20 +0100 Subject: [PATCH] [kube-proxy/ipvs] Generalize handling of InactiveConn to TCP --- pkg/proxy/ipvs/graceful_termination.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/proxy/ipvs/graceful_termination.go b/pkg/proxy/ipvs/graceful_termination.go index 2ec005afc8..a705bb9585 100644 --- a/pkg/proxy/ipvs/graceful_termination.go +++ b/pkg/proxy/ipvs/graceful_termination.go @@ -164,8 +164,10 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e } for _, rs := range rss { if rsToDelete.RealServer.Equal(rs) { - // Don't delete TCP RS with Active Connections or UDP RS (ActiveConn is always 0 for UDP) - if rs.ActiveConn != 0 || (rsToDelete.VirtualServer.Protocol == "UDP" && rs.InactiveConn != 0) { + // Delete RS with no connections + // For UDP, ActiveConn is always 0 + // For TCP, InactiveConn are connections not in ESTABLISHED state + if rs.ActiveConn+rs.InactiveConn != 0 { return false, nil } klog.Infof("Deleting rs: %s", rsToDelete.String())