Skip to content

Commit

Permalink
Fix logging to the healthcheck's waiting for targets
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo J. Ortega U. <5791035+ejortegau@users.noreply.github.com>
  • Loading branch information
ejortegau committed Nov 27, 2024
1 parent a82a8d1 commit 49ac1ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ func (hc *HealthCheckImpl) WaitForAllServingTablets(ctx context.Context, targets

// waitForTablets is the internal method that polls for tablets.
func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.Target, requireServing bool) error {
log.Infof("Starting wait for tablets loop...")
waitLogSoFar := 0 * time.Second
waitLogPeriod := 5 * time.Second

for {
// We nil targets as we find them.
allPresent := true
Expand Down Expand Up @@ -760,8 +764,6 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.

// Unblock after the sleep or when the context has expired.
timer := time.NewTimer(waitAvailableTabletInterval)
waitLogPeriod := 5 * time.Second
waitLogSoFar := 0 * time.Second
select {
case <-ctx.Done():
timer.Stop()
Expand Down

0 comments on commit 49ac1ad

Please sign in to comment.