From 8d6244adfac46652641c30388c3baa01184d37b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 9 Jan 2025 17:24:21 +0000 Subject: [PATCH] don't wait 10 minutes when slot still in use --- flow/workflows/cdc_flow.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flow/workflows/cdc_flow.go b/flow/workflows/cdc_flow.go index d3bf1a7a3..8a260e244 100644 --- a/flow/workflows/cdc_flow.go +++ b/flow/workflows/cdc_flow.go @@ -506,8 +506,15 @@ func CDCFlowWorkflow( } else { logger.Error("error in sync flow", slog.Any("error", err)) } - logger.Info("sync flow errored, sleeping for 10 minutes before retrying") - _ = workflow.Sleep(ctx, 10*time.Minute) + + // cannot use shared.IsSQLStateError because temporal serialize/deserialize + if strings.Contains(err.Error(), "(SQLSTATE 55006)") { + logger.Info("sync flow errored, sleeping for 1 minute before retrying") + _ = workflow.Sleep(ctx, time.Minute) + } else { + logger.Info("sync flow errored, sleeping for 10 minutes before retrying") + _ = workflow.Sleep(ctx, 10*time.Minute) + } } else { logger.Info("sync finished") }