Skip to content

Commit 84096f0

Browse files
authored
Merge pull request kubernetes#94968 from Lion-Wei/fix-session-affinity-case
fix session affinity related flaky cases in ipvs proxy mode
2 parents f20a36f + 624f5f9 commit 84096f0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/e2e/network/service.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3408,7 +3408,19 @@ func execAffinityTestForSessionAffinityTimeout(f *framework.Framework, cs client
34083408
if hosts.Len() > 1 {
34093409
return
34103410
}
3411-
time.Sleep(time.Duration(svcSessionAffinityTimeout) * time.Second)
3411+
// In some case, ipvs didn't deleted the persistent connection after timeout expired,
3412+
// use 'ipvsadm -lnc' command can found the expire time become '13171233:02' after '00:00'
3413+
//
3414+
// pro expire state source virtual destination
3415+
// TCP 00:00 NONE 10.105.253.160:0 10.105.253.160:80 10.244.1.25:9376
3416+
//
3417+
// pro expire state source virtual destination
3418+
// TCP 13171233:02 NONE 10.105.253.160:0 10.105.253.160:80 10.244.1.25:9376
3419+
//
3420+
// And 2 seconds later, the connection will be ensure deleted,
3421+
// so we sleep 'svcSessionAffinityTimeout+5' seconds to avoid this issue.
3422+
// TODO: figure out why the expired connection didn't be deleted and fix this issue in ipvs side.
3423+
time.Sleep(time.Duration(svcSessionAffinityTimeout+5) * time.Second)
34123424
}
34133425
}
34143426
framework.Fail("Session is sticky after reaching the timeout")

0 commit comments

Comments
 (0)