pingzh commented on a change in pull request #9616:
URL: https://github.com/apache/airflow/pull/9616#discussion_r453344905



##########
File path: airflow/jobs/local_task_job.py
##########
@@ -135,7 +135,11 @@ def heartbeat_callback(self, session=None):
             self.task_runner.terminate()
             return
 
-        self.task_instance.refresh_from_db()
+        if session is None:
+            self.task_instance.refresh_from_db()
+        else:
+            self.task_instance.refresh_from_db(session=session)

Review comment:
       After more thoughts, it looks like we don't actually need this PR, as 
the airflow use `scoped_session`, which will use the same session, no matter 
whether we pass the `session` to the `refresh_from_db`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to