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


##########
airflow/api/common/mark_tasks.py:
##########
@@ -154,6 +154,12 @@ def set_state(
             qry_sub_dag = all_subdag_tasks_query(sub_dag_run_ids, session, 
state, confirmed_dates)
             tis_altered += qry_sub_dag.with_for_update().all()
         for task_instance in tis_altered:
+            # The try_number was decremented when setting to up_for_reschedule 
and deferred.
+            # Increment it back when changing the state again
+            if task_instance.state is not None and task_instance.state in (
+                State.UP_FOR_RESCHEDULE or State.DEFERRED
+            ):

Review Comment:
   ```suggestion
               if task_instance.state in (
                   TaskInstanceState.UP_FOR_RESCHEDULE, 
TaskInstanceState.DEFERRED
               ):
   ```
   
   I think this is the intended logic? Since this logic is also duplicated in 
`www/utils.py`, perhaps we should add an entry in `State` similar to 
`State.running`?



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