zhongjiajie commented on a change in pull request #8259: [AIRFLOW-XXX] Optimize
airflow scheduler
URL: https://github.com/apache/airflow/pull/8259#discussion_r407320763
##########
File path: airflow/jobs.py
##########
@@ -1644,26 +1738,31 @@ def _execute_helper(self, processor_manager):
# If a task instance is up for retry but the corresponding DAG
run
# isn't running, mark the task instance as FAILED so we don't
try
# to re-run it.
- self._change_state_for_tis_without_dagrun(simple_dag_bag,
- [State.UP_FOR_RETRY],
- State.FAILED)
+ ret = self._change_state_for_tis_without_dagrun(simple_dag_bag,
+
[State.UP_FOR_RETRY],
+ State.FAILED)
+ if not ret:
+ continue
# If a task instance is scheduled or queued, but the
corresponding
# DAG run isn't running, set the state to NONE so we don't try
to
# re-run it.
- self._change_state_for_tis_without_dagrun(simple_dag_bag,
- [State.QUEUED,
- State.SCHEDULED],
- State.NONE)
-
+ ret = self._change_state_for_tis_without_dagrun(simple_dag_bag,
+ [State.QUEUED,
+
State.SCHEDULED],
+ State.NONE)
+ if not ret:
+ continue
self._execute_task_instances(simple_dag_bag,
(State.SCHEDULED,))
# Call heartbeats
self.log.info("Heartbeating the executor")
self.executor.heartbeat()
- # Process events from the executor
- self._process_executor_events(simple_dag_bag)
+ # Process all events from the executor
+ full_simple_dag_bag = SimpleDagBag(self.full_simple_dags.values())
+ self.executor_events =
self._process_executor_events(full_simple_dag_bag)
Review comment:
Hi, @buhuipao I know what you said, but pls take a look at Jarek said above.
> We want to encourage people to update to the latest released 1.10 version
rather than fix the old version.
User would use latest release instead of 1.9, so I think we should target to
master branch. And I check your UPDATING.md, maybe we should separate PR which
easy to review, WDYT
----------------------------------------------------------------
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]
With regards,
Apache Git Services