Skip to content

Commit

Permalink
use topo.RemoteOperationTimeout context in OpenTabletDiscovery
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Nov 14, 2024
1 parent 621e2a6 commit bfb151f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vtorc/logic/tablet_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func OpenTabletDiscovery() <-chan time.Time {
}
// We refresh all information from the topo once before we start the ticks to do
// it on a timer. We can wait forever (context.Background()) for this call.
if err := refreshAllInformation(context.Background()); err != nil {
ctx, cancel := context.WithTimeout(context.Background(), topo.RemoteOperationTimeout)
defer cancel()
if err := refreshAllInformation(ctx); err != nil {
log.Errorf("failed to initialize topo information: %+v", err)
}
return time.Tick(time.Second * time.Duration(config.Config.TopoInformationRefreshSeconds)) //nolint SA1015: using time.Tick leaks the underlying ticker
Expand Down

0 comments on commit bfb151f

Please sign in to comment.