Skip to content

Commit

Permalink
Merge pull request #71847 from DataDog/automated-cherry-pick-of-#7151…
Browse files Browse the repository at this point in the history
…5-upstream-release-1.12

Automated cherry pick of #71515 upstream release 1.12
  • Loading branch information
k8s-ci-robot committed Dec 10, 2018
2 parents 72722ba + de1a73f commit 51b823e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions pkg/proxy/ipvs/graceful_termination.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ func (q *graceTerminateRSList) remove(rs *listItem) bool {

uniqueRS := rs.String()
if _, ok := q.list[uniqueRS]; ok {
return false
delete(q.list, uniqueRS)
return true
}
delete(q.list, uniqueRS)
return true
return false
}

func (q *graceTerminateRSList) flushList(handler func(rsToDelete *listItem) (bool, error)) bool {
Expand Down Expand Up @@ -164,7 +164,10 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e
}
for _, rs := range rss {
if rsToDelete.RealServer.Equal(rs) {
if rs.ActiveConn != 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
}
glog.Infof("Deleting rs: %s", rsToDelete.String())
Expand Down
2 changes: 1 addition & 1 deletion pkg/proxy/ipvs/proxier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
Port: uint16(portNum),
}

glog.V(5).Infof("Using graceful delete to delete: %v", delDest)
glog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS)
err = proxier.gracefuldeleteManager.GracefulDeleteRS(appliedVirtualServer, delDest)
if err != nil {
glog.Errorf("Failed to delete destination: %v, error: %v", delDest, err)
Expand Down

0 comments on commit 51b823e

Please sign in to comment.