Skip to content

Commit

Permalink
UPSTREAM: <carry>: replace newETCD3ProberMonitor with etcd3RetryingPr…
Browse files Browse the repository at this point in the history
…oberMonitor
  • Loading branch information
p0lyn0mial authored and atiratree committed Oct 1, 2024
1 parent cc3ae63 commit 1e588a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ func newETCD3Check(c storagebackend.Config, timeout time.Duration, stopCh <-chan
// retry in a loop in the background until we successfully create the client, storing the client or error encountered

lock := sync.RWMutex{}
var prober *etcd3ProberMonitor
var prober *etcd3RetryingProberMonitor
clientErr := fmt.Errorf("etcd client connection not yet established")

go wait.PollImmediateUntil(time.Second, func() (bool, error) {
lock.Lock()
defer lock.Unlock()
newProber, err := newETCD3ProberMonitor(c)
newProber, err := newRetryingETCD3ProberMonitor(c)
// Ensure that server is already not shutting down.
select {
case <-stopCh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func CreateProber(c storagebackend.Config) (Prober, error) {
case storagebackend.StorageTypeETCD2:
return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type)
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
return newETCD3ProberMonitor(c)
return newRetryingETCD3ProberMonitor(c)
default:
return nil, fmt.Errorf("unknown storage type: %s", c.Type)
}
Expand All @@ -80,7 +80,7 @@ func CreateMonitor(c storagebackend.Config) (metrics.Monitor, error) {
case storagebackend.StorageTypeETCD2:
return nil, fmt.Errorf("%s is no longer a supported storage backend", c.Type)
case storagebackend.StorageTypeUnset, storagebackend.StorageTypeETCD3:
return newETCD3ProberMonitor(c)
return newRetryingETCD3ProberMonitor(c)
default:
return nil, fmt.Errorf("unknown storage type: %s", c.Type)
}
Expand Down

0 comments on commit 1e588a9

Please sign in to comment.