ephraimbuddy commented on a change in pull request #16475:
URL: https://github.com/apache/airflow/pull/16475#discussion_r652533594
##########
File path: airflow/jobs/backfill_job.py
##########
@@ -471,6 +476,16 @@ def _per_task_process(key, ti, session=None): # pylint:
disable=too-many-return
ti_status.running.pop(key)
# Reset the failed task in backfill to scheduled state
ti.set_state(State.SCHEDULED, session=session)
+ elif self.rerun_succeeded_tasks:
+ # Rerun succeeded tasks
+ if ti.state in (State.SUCCESS):
+ self.log.error("Task instance {ti} "
+ "with state {state}".format(ti=ti,
+
state=ti.state))
+ if key in ti_status.running:
+ ti_status.running.pop(key)
+ # Reset the succeeded task in backfill to scheduled
state
+ ti.set_state(State.SCHEDULED, session=session)
Review comment:
```suggestion
elif self.rerun_succeeded_tasks and ti.state ==
State.SUCCESS:
# Rerun succeeded tasks
self.log.error("Task instance {ti} with state
{state}".format(ti=ti,
state=ti.state))
if key in ti_status.running:
ti_status.running.pop(key)
# Reset the succeeded task in backfill to scheduled state
ti.set_state(State.SCHEDULED, session=session)
```
--
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]