yuqian90 commented on pull request #16681:
URL: https://github.com/apache/airflow/pull/16681#issuecomment-870493349


   > Is a new state strictly required for this? Cos each state we add needs to 
be shown in the UI and increases the possible places we need to deal with the 
new state
   
   I think another way to implement this is to make `clear_task_instances` 
increase the `max_tries` of the running `TaskInstance` by 1. However, when I 
tried to do that I realized it's easy. There are more places that need to be 
changed to do the right thing. One example is `is_eligible_to_retry()`. It 
first checks if `self.task.retries` is zero. If it is, it short-circuits and 
returns False. But `self.task.retries` isn't something that can be incremented 
by  `clear_task_instances` because it's not stored in the db.
   
   ```
       def is_eligible_to_retry(self):
           """Is task instance is eligible for retry"""
           return self.task.retries and self.try_number <= self.max_tries
   ```


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