Merge pull request #94968 from Lion-Wei/fix-session-affinity-case

fix session affinity related flaky cases in ipvs proxy mode
This commit is contained in:
Kubernetes Prow Robot 2020-10-23 15:19:00 -07:00 committed by GitHub
commit 84096f02e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3408,7 +3408,19 @@ func execAffinityTestForSessionAffinityTimeout(f *framework.Framework, cs client
if hosts.Len() > 1 {
return
}
time.Sleep(time.Duration(svcSessionAffinityTimeout) * time.Second)
// In some case, ipvs didn't deleted the persistent connection after timeout expired,
// use 'ipvsadm -lnc' command can found the expire time become '13171233:02' after '00:00'
//
// pro expire state source virtual destination
// TCP 00:00 NONE 10.105.253.160:0 10.105.253.160:80 10.244.1.25:9376
//
// pro expire state source virtual destination
// TCP 13171233:02 NONE 10.105.253.160:0 10.105.253.160:80 10.244.1.25:9376
//
// And 2 seconds later, the connection will be ensure deleted,
// so we sleep 'svcSessionAffinityTimeout+5' seconds to avoid this issue.
// TODO: figure out why the expired connection didn't be deleted and fix this issue in ipvs side.
time.Sleep(time.Duration(svcSessionAffinityTimeout+5) * time.Second)
}
}
framework.Fail("Session is sticky after reaching the timeout")