mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Get rid of un-needed lock
This commit is contained in:
parent
a559d8d9b2
commit
dd9c562769
@ -347,15 +347,10 @@ func (proxier *Proxier) setServiceInfo(service string, info *serviceInfo) {
|
||||
proxier.serviceMap[service] = info
|
||||
}
|
||||
|
||||
// used to globally lock around unused ports. Only used in testing.
|
||||
var unusedPortLock sync.Mutex
|
||||
|
||||
// addServiceOnUnusedPort starts listening for a new service, returning the
|
||||
// port it's using. For testing on a system with unknown ports used. The timeout only applies to UDP
|
||||
// connections, for now.
|
||||
func (proxier *Proxier) addServiceOnUnusedPort(service, protocol string, timeout time.Duration) (string, error) {
|
||||
unusedPortLock.Lock()
|
||||
defer unusedPortLock.Unlock()
|
||||
sock, err := newProxySocket(protocol, proxier.address, 0)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
Loading…
Reference in New Issue
Block a user