Commit de95511d authored by Laurent Bernaille's avatar Laurent Bernaille

Generalize handling of InactiveConn to TCP

parent 437edead
...@@ -164,8 +164,10 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e ...@@ -164,8 +164,10 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e
} }
for _, rs := range rss { for _, rs := range rss {
if rsToDelete.RealServer.Equal(rs) { if rsToDelete.RealServer.Equal(rs) {
// Don't delete TCP RS with Active Connections or UDP RS (ActiveConn is always 0 for UDP) // Delete RS with no connections
if rs.ActiveConn != 0 || (rsToDelete.VirtualServer.Protocol == "UDP" && rs.InactiveConn != 0) { // For UDP, ActiveConn is always 0
// For TCP, InactiveConn are connections not in ESTABLISHED state
if rs.ActiveConn+rs.InactiveConn != 0 {
return false, nil return false, nil
} }
klog.Infof("Deleting rs: %s", rsToDelete.String()) klog.Infof("Deleting rs: %s", rsToDelete.String())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment