Skip to content

Commit

Permalink
WaitForSourceConnector: log attempts > 2
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 16, 2024
1 parent cc5bf9d commit 4ccc9dd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
}
Expand Down

0 comments on commit 4ccc9dd

Please sign in to comment.