From 3126c6e4b621bbbb2faf9aebc7066ed781d59e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Wed, 19 Jun 2024 15:28:48 +0200 Subject: [PATCH] fix: Do not retry on TemporalScheduleNotFoundError We were already not retrying in the main backfill activity. However, we were not catching this error in the first `get_schedule_frequency` activity, which can fail indefinitely. --- posthog/temporal/batch_exports/backfill_batch_export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posthog/temporal/batch_exports/backfill_batch_export.py b/posthog/temporal/batch_exports/backfill_batch_export.py index c23a211c04b44..75df851caefdc 100644 --- a/posthog/temporal/batch_exports/backfill_batch_export.py +++ b/posthog/temporal/batch_exports/backfill_batch_export.py @@ -319,7 +319,9 @@ async def run(self, inputs: BackfillBatchExportInputs) -> None: get_schedule_frequency, inputs.batch_export_id, start_to_close_timeout=dt.timedelta(minutes=1), - retry_policy=temporalio.common.RetryPolicy(maximum_attempts=0), + retry_policy=temporalio.common.RetryPolicy( + maximum_attempts=0, non_retryable_error_types=["TemporalScheduleNotFoundError"] + ), ) # Temporal requires that we set a timeout.