From abb53cb4610af9f129cf16ef3cf410a3ea37d1d9 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U." <5791035+ejortegau@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:17:34 +0100 Subject: [PATCH] Retry waiting for tablets during vtgate initialization if they timeout. Signed-off-by: Eduardo J. Ortega U. <5791035+ejortegau@users.noreply.github.com> --- go/vt/vtgate/vtgate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/vt/vtgate/vtgate.go b/go/vt/vtgate/vtgate.go index 298f683be16..6d297d38fa8 100644 --- a/go/vt/vtgate/vtgate.go +++ b/go/vt/vtgate/vtgate.go @@ -297,9 +297,12 @@ func Init( gw.RegisterStats() // Retry loop for potential time-outs waiting for all tablets. +OuterLoop: for { err := gw.WaitForTablets(ctx, tabletTypesToWait) switch { + case err == nil: + break OuterLoop case errors.Is(err, context.DeadlineExceeded): log.Warning("TabletGateway timed out waiting for tablets to become available - retrying.")