mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Merge pull request #2668 from meirf/set-initial-udp-proxy-timeout
Set initial timeout upon UDP proxy connection creation
This commit is contained in:
commit
50cf0c1b23
@ -226,6 +226,10 @@ func (udp *udpProxySocket) getBackendConn(activeClients *clientCache, cliAddr ne
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if err = svrConn.SetDeadline(time.Now().Add(timeout)); err != nil {
|
||||||
|
glog.Errorf("SetDeadline failed: %v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
activeClients.clients[cliAddr.String()] = svrConn
|
activeClients.clients[cliAddr.String()] = svrConn
|
||||||
go func(cliAddr net.Addr, svrConn net.Conn, activeClients *clientCache, timeout time.Duration) {
|
go func(cliAddr net.Addr, svrConn net.Conn, activeClients *clientCache, timeout time.Duration) {
|
||||||
defer util.HandleCrash()
|
defer util.HandleCrash()
|
||||||
|
Loading…
Reference in New Issue
Block a user