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 bc7516b565531a1b333e6b3984cfc0e527083da2 Author: Jarek Potiuk <[email protected]> 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
