mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
fix race on etcd client constructor for healthchecks
Change-Id: Id29b5b377989dcb5377316cfcdea367071a47365
This commit is contained in:
parent
68d79b0d69
commit
77b3bb0f69
@ -157,10 +157,10 @@ func newETCD3Check(c storagebackend.Config, timeout time.Duration, stopCh <-chan
|
|||||||
var prober *etcd3ProberMonitor
|
var prober *etcd3ProberMonitor
|
||||||
clientErr := fmt.Errorf("etcd client connection not yet established")
|
clientErr := fmt.Errorf("etcd client connection not yet established")
|
||||||
|
|
||||||
go wait.PollUntil(time.Second, func() (bool, error) {
|
go wait.PollImmediateUntil(time.Second, func() (bool, error) {
|
||||||
newProber, err := newETCD3ProberMonitor(c)
|
|
||||||
lock.Lock()
|
lock.Lock()
|
||||||
defer lock.Unlock()
|
defer lock.Unlock()
|
||||||
|
newProber, err := newETCD3ProberMonitor(c)
|
||||||
// Ensure that server is already not shutting down.
|
// Ensure that server is already not shutting down.
|
||||||
select {
|
select {
|
||||||
case <-stopCh:
|
case <-stopCh:
|
||||||
|
Loading…
Reference in New Issue
Block a user