mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
don't serialize etcd healthchecks
This commit is contained in:
parent
891cbede96
commit
5a67248115
@ -127,7 +127,7 @@ func newETCD3Check(c storagebackend.Config, timeout time.Duration, stopCh <-chan
|
|||||||
// constructing the etcd v3 client blocks and times out if etcd is not available.
|
// constructing the etcd v3 client blocks and times out if etcd is not available.
|
||||||
// retry in a loop in the background until we successfully create the client, storing the client or error encountered
|
// retry in a loop in the background until we successfully create the client, storing the client or error encountered
|
||||||
|
|
||||||
lock := sync.Mutex{}
|
lock := sync.RWMutex{}
|
||||||
var client *clientv3.Client
|
var client *clientv3.Client
|
||||||
clientErr := fmt.Errorf("etcd client connection not yet established")
|
clientErr := fmt.Errorf("etcd client connection not yet established")
|
||||||
|
|
||||||
@ -175,8 +175,8 @@ func newETCD3Check(c storagebackend.Config, timeout time.Duration, stopCh <-chan
|
|||||||
// not be closed during healthcheck.
|
// not be closed during healthcheck.
|
||||||
// Given that healthchecks has a 2s timeout, worst case of blocking
|
// Given that healthchecks has a 2s timeout, worst case of blocking
|
||||||
// shutdown for additional 2s seems acceptable.
|
// shutdown for additional 2s seems acceptable.
|
||||||
lock.Lock()
|
lock.RLock()
|
||||||
defer lock.Unlock()
|
defer lock.RUnlock()
|
||||||
if clientErr != nil {
|
if clientErr != nil {
|
||||||
return clientErr
|
return clientErr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user