Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): clarify the sync error shown after a lock takeover (#80220)

Tom Owersf76fe4edd896
diff --git a/products/warehouse_sources/backend/temporal/data_imports/metrics.py b/products/warehouse_sources/backend/temporal/data_imports/metrics.py
index 5a78078f277e..d7263befae32 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/metrics.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/metrics.py
@@ -31,7 +31,12 @@ TERMINAL_JOB_STATUSES: frozenset[str] = frozenset(_TERMINAL_STATUS_TO_METRIC)
# latest_error written when lock takeover force-fails a stuck-RUNNING job; sentinel that
# lets update_external_job_status permit Failed -> Completed for takeover-failed jobs only.
-LOCK_TAKEOVER_LATEST_ERROR = "Lock takeover: workflow terminated but job was stuck in RUNNING"
+# Shown to the customer verbatim, so keep it plain; the exact string is the recovery sentinel,
+# so all comparisons must go through this constant rather than the literal.
+LOCK_TAKEOVER_LATEST_ERROR = (
+ "A previous sync run did not shut down cleanly and was still marked as running. "
+ "PostHog cleaned it up so syncing can continue. No action is needed."
+)
def get_data_import_finished_metric(source_type: str | None, status: str) -> MetricCounter: