ashb commented on a change in pull request #10956:
URL: https://github.com/apache/airflow/pull/10956#discussion_r492163936



##########
File path: airflow/jobs/backfill_job.py
##########
@@ -629,6 +629,7 @@ def _per_task_process(task, key, ti, session=None):  # 
pylint: disable=too-many-
             _dag_runs = ti_status.active_runs[:]
             for run in _dag_runs:
                 run.update_state(session=session)
+                session.merge(run)

Review comment:
       It is, yes, but I can do this better
   
   In 
[dagrun.py](https://github.com/apache/airflow/pull/10956/files#diff-32aa8dbb910719ef24a39cab5d0f2a97L376-L379)
 I removed the commit (on purpose) but also removed the merge by mistake:
   
   ```diff
   -        # todo: determine we want to use with_for_update to make sure to 
lock the run
   -        session.merge(self)
   -        session.commit()
   -
   ```
   
   ->
   
   
   ```diff
   -        # todo: determine we want to use with_for_update to make sure to 
lock the run
           session.merge(self)
   -        session.commit()
   -
   ```




----------------------------------------------------------------
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:
[email protected]


Reply via email to