From 3c5ff23fbe83bcd986815ea4e4cac55d463ead77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Thu, 19 Oct 2023 19:48:36 +0200 Subject: [PATCH 1/2] chore(batch-exports): Do not retry on RefreshError --- posthog/temporal/workflows/bigquery_batch_export.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posthog/temporal/workflows/bigquery_batch_export.py b/posthog/temporal/workflows/bigquery_batch_export.py index cef81d98ae073..b339d13e34646 100644 --- a/posthog/temporal/workflows/bigquery_batch_export.py +++ b/posthog/temporal/workflows/bigquery_batch_export.py @@ -263,6 +263,8 @@ async def run(self, inputs: BigQueryBatchExportInputs): non_retryable_error_types=[ # Raised on missing permissions "Forbidden", + # Invalid token + "RefreshError", ], ), ) From 12973e47233b38a2d5a91c09144167cab359b565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Thu, 19 Oct 2023 23:13:18 +0200 Subject: [PATCH 2/2] chore(bigquery-batch-exports): Add one more non retryable error NotFound should also be not retried as it means a dataset or project doesn't exist (maybe a typo) --- posthog/temporal/workflows/bigquery_batch_export.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posthog/temporal/workflows/bigquery_batch_export.py b/posthog/temporal/workflows/bigquery_batch_export.py index b339d13e34646..01a1a622633fb 100644 --- a/posthog/temporal/workflows/bigquery_batch_export.py +++ b/posthog/temporal/workflows/bigquery_batch_export.py @@ -261,10 +261,12 @@ async def run(self, inputs: BigQueryBatchExportInputs): maximum_interval=dt.timedelta(seconds=120), maximum_attempts=10, non_retryable_error_types=[ - # Raised on missing permissions + # Raised on missing permissions. "Forbidden", - # Invalid token + # Invalid token. "RefreshError", + # Usually means the dataset or project doesn't exist. + "NotFound", ], ), )