mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Squashed commit of the following:
commit 7bf1a05f61b78196c8d272e0d55980ba2254e81d Author: gaozheng <gaozheng0123@163.com> Date: Thu Apr 28 01:23:42 2016 +0000 fix gofmt commit 54f6fa6ca76ee0fc5c4f8609fb2f875111ce2141 Author: Gao Zheng <gaozheng0123@163.com> Date: Sat Apr 23 13:09:41 2016 +0000 reset session affinity if endpoint is unconnected
This commit is contained in:
@@ -87,8 +87,9 @@ func (tcp *tcpProxySocket) ListenPort() int {
|
||||
}
|
||||
|
||||
func tryConnect(service proxy.ServicePortName, srcAddr net.Addr, protocol string, proxier *Proxier) (out net.Conn, err error) {
|
||||
sessionAffinityReset := false
|
||||
for _, dialTimeout := range endpointDialTimeout {
|
||||
endpoint, err := proxier.loadBalancer.NextEndpoint(service, srcAddr)
|
||||
endpoint, err := proxier.loadBalancer.NextEndpoint(service, srcAddr, sessionAffinityReset)
|
||||
if err != nil {
|
||||
glog.Errorf("Couldn't find an endpoint for %s: %v", service, err)
|
||||
return nil, err
|
||||
@@ -102,6 +103,7 @@ func tryConnect(service proxy.ServicePortName, srcAddr net.Addr, protocol string
|
||||
panic("Dial failed: " + err.Error())
|
||||
}
|
||||
glog.Errorf("Dial failed: %v", err)
|
||||
sessionAffinityReset = true
|
||||
continue
|
||||
}
|
||||
return outConn, nil
|
||||
|
||||
Reference in New Issue
Block a user