uranusjr commented on code in PR #26205:
URL: https://github.com/apache/airflow/pull/26205#discussion_r968207248


##########
airflow/jobs/backfill_job.py:
##########
@@ -218,6 +218,13 @@ def _update_counters(self, ti_status, session=None):
                 ti_status.running.pop(reduced_key)
                 ti_status.to_run[ti.key] = ti
 
+            elif ti.state == TaskInstanceState.SCHEDULED:
+                # Deferrable task can go from DEFERRED to SCHEDULED,
+                # when that happens, we need to remove it from running
+                # and add it to to_run
+                ti_status.running.pop(ti.key)
+                ti_status.to_run[ti.key] = ti

Review Comment:
   ```suggestion
               # special case: Deferrable task can go from DEFERRED to 
SCHEDULED;
               # when that happens, we need to put it back as in 
UP_FOR_RESCHEDULE
               elif ti.state == TaskInstanceState.SCHEDULED:
                   self.log.debug("Task instance %s is resumed from deferred 
state", ti)
                   ti_status.running.pop(ti.key)
                   ti_status.to_run[ti.key] = ti
   ```
   
   Match styles of other blocks. Perhaps put this block right after the 
`UP_FOR_RESCHEDULE` one for clarity?



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