uranusjr commented on a change in pull request #16741:
URL: https://github.com/apache/airflow/pull/16741#discussion_r669241514



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -856,13 +857,18 @@ def _do_scheduling(self, session) -> int:
                 # But this would take care of the scenario when the Scheduler 
is restarted after DagRun is
                 # created and the DAG is deleted / renamed
                 try:
-                    self._schedule_dag_run(dag_run, session)
+                    callback_to_run = self._schedule_dag_run(dag_run, session)
+                    callback_tuples.append((dag_run, callback_to_run))
                 except SerializedDagNotFound:
                     self.log.exception("DAG '%s' not found in serialized_dag 
table", dag_run.dag_id)
                     continue
 
             guard.commit()
 
+            # We will send the callbacks after we commit to ensure the context 
is up to date when it gets run

Review comment:
       ```suggestion
               # Send the callbacks after we commit to ensure the context is up 
to date when it gets run
   ```
   
   The “we will” part doesn’t sound right to me; the callbacks *are* being sent 
now, not some time in the future.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to