You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/12 14:56:53 UTC

[airflow] 02/04: Avoid sharing session with RenderedTaskInstanceFields write and delete (#9993)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 7061c8316f99c6d91026acbd279812f2808870f4
Author: zikun <33...@users.noreply.github.com>
AuthorDate: Sun Jul 26 01:55:05 2020 +0800

    Avoid sharing session with RenderedTaskInstanceFields write and delete (#9993)
    
    Sharing session with RTIF leads to idle-in-transaction timeout error when DAG serialization is enabled and task running duration exceeds the idle-in-transaction timeout setting of the database.
    
    (cherry picked from commit ffcd0604e3f15e1b2a3ac1d8c97a35be7374cfab)
---
 airflow/models/taskinstance.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 0e5d6e3..ae296ba 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -964,8 +964,8 @@ class TaskInstance(Base, LoggingMixin):
 
                 self.render_templates(context=context)
                 if STORE_SERIALIZED_DAGS:
-                    RTIF.write(RTIF(ti=self, render_templates=False), session=session)
-                    RTIF.delete_old_records(self.task_id, self.dag_id, session=session)
+                    RTIF.write(RTIF(ti=self, render_templates=False))
+                    RTIF.delete_old_records(self.task_id, self.dag_id)
 
                 task_copy.pre_execute(context=context)