Skip to content

Commit e4716f1

Browse files
authored
Merge pull request #777 from kinvolk/imran/backport-stalecount-fix-to-release-0.31
Backport merge commit of #775 to release-0.31
2 parents e3f2a9a + e0115bb commit e4716f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/agent/clientset.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,14 @@ func (cs *ClientSet) connectOnce() (int, error) {
275275
if err != nil {
276276
return serverCount, err
277277
}
278-
cs.lastReceivedServerCount = receivedServerCount
279278
if err := cs.AddClient(c.serverID, c); err != nil {
280279
c.Close()
281280
return serverCount, err
282281
}
282+
// By moving the update to here, we only accept the server count from a server
283+
// that we have successfully added to our active client set, implicitly ignoring
284+
// stale data from duplicate connection attempts.
285+
cs.lastReceivedServerCount = receivedServerCount
283286
klog.V(2).InfoS("sync added client connecting to proxy server", "serverID", c.serverID)
284287

285288
labels := runpprof.Labels(

0 commit comments

Comments
 (0)