From 4ccc9dd6ef0ffa531af9bd56700b4e682e242cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 16 Feb 2024 13:31:28 +0000 Subject: [PATCH] WaitForSourceConnector: log attempts > 2 --- flow/activities/flowable.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flow/activities/flowable.go b/flow/activities/flowable.go index acda08cc63..efdafbbb62 100644 --- a/flow/activities/flowable.go +++ b/flow/activities/flowable.go @@ -275,10 +275,9 @@ func (a *FlowableActivity) MaintainPull( } } -func (a *FlowableActivity) WaitForSourceConnector( - ctx context.Context, - sessionID string, -) error { +func (a *FlowableActivity) WaitForSourceConnector(ctx context.Context, sessionID string) error { + logger := activity.GetLogger(ctx) + attempt := 0 for { a.CdcCacheRw.RLock() _, ok := a.CdcCache[sessionID] @@ -287,6 +286,10 @@ func (a *FlowableActivity) WaitForSourceConnector( return nil } activity.RecordHeartbeat(ctx, "wait another second for source connector") + attempt += 1 + if attempt > 2 { + logger.Error("waiting on source connector setup", slog.Int("attempt", attempt)) + } if err := ctx.Err(); err != nil { return err }