You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/07/06 20:22:38 UTC
[airflow] 26/39: Retry transactions on occasional deadlocks for rendered fields (#32341)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-6-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 0e4ee0092b6b4fabe4cb38036a88d69a042cee17
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Jul 5 13:28:16 2023 +0200
Retry transactions on occasional deadlocks for rendered fields (#32341)
This is a follow-up on #18616 where we introduced retries on the
occassional deadlocks when rendered task fields have been deleted
by parallel threads (this is not a real deadlock, it's because
MySQL locks too many things when queries are executed and will
deadlock when one of those queries wait too much).
Adding retry - while not perfect - should allow to handle the
problem and significantly decrease the likelihood of such
deadlocks.
We can probably think about different approach for rendered fields,
but for now retrying is - I think - acceptable short-term fix.
Fixes: #32294
Fixes: #29687
(cherry picked from commit c8a3c112a7bae345d37bb8b90d68c8d6ff2ef8fc)
---
airflow/models/renderedtifields.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/airflow/models/renderedtifields.py b/airflow/models/renderedtifields.py
index 7fd2c29edf..4620b38f5c 100644
--- a/airflow/models/renderedtifields.py
+++ b/airflow/models/renderedtifields.py
@@ -175,6 +175,7 @@ class RenderedTaskInstanceFields(Base):
return result.k8s_pod_yaml if result else None
@provide_session
+ @retry_db_transaction
def write(self, session: Session = None):
"""Write instance to database