mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Wrap goroutines in HandleCrash()
This commit is contained in:
parent
1e50f118fd
commit
3181f3555d
@ -213,7 +213,10 @@ func (udp *udpProxySocket) getBackendConn(activeClients *clientCache, cliAddr ne
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
activeClients.clients[cliAddr.String()] = svrConn
|
activeClients.clients[cliAddr.String()] = svrConn
|
||||||
go udp.proxyClient(cliAddr, svrConn, activeClients, timeout)
|
go func(cliAddr net.Addr, svrConn net.Conn, activeClients *clientCache, timeout time.Duration) {
|
||||||
|
defer util.HandleCrash()
|
||||||
|
udp.proxyClient(cliAddr, svrConn, activeClients, timeout)
|
||||||
|
}(cliAddr, svrConn, activeClients, timeout)
|
||||||
}
|
}
|
||||||
return svrConn, nil
|
return svrConn, nil
|
||||||
}
|
}
|
||||||
@ -375,7 +378,10 @@ func (proxier *Proxier) addServiceOnUnusedPort(service, protocol string, timeout
|
|||||||
|
|
||||||
func (proxier *Proxier) startAccepting(service string, sock proxySocket) {
|
func (proxier *Proxier) startAccepting(service string, sock proxySocket) {
|
||||||
glog.Infof("Listening for %s on %s:%s", service, sock.Addr().Network(), sock.Addr().String())
|
glog.Infof("Listening for %s on %s:%s", service, sock.Addr().Network(), sock.Addr().String())
|
||||||
go sock.ProxyLoop(service, proxier)
|
go func(service string, proxier *Proxier) {
|
||||||
|
defer util.HandleCrash()
|
||||||
|
sock.ProxyLoop(service, proxier)
|
||||||
|
}(service, proxier)
|
||||||
}
|
}
|
||||||
|
|
||||||
// How long we leave idle UDP connections open.
|
// How long we leave idle UDP connections open.
|
||||||
|
Loading…
Reference in New Issue
Block a user