You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/12 01:32:30 UTC

[GitHub] [airflow] tanvn edited a comment on issue #18080: Wrong try_number after rescheduling makes remote logging store all the logs with wrong log_id

tanvn edited a comment on issue #18080:
URL: https://github.com/apache/airflow/issues/18080#issuecomment-966508600


   I got the same issue today with version 2.2.1 (the latest)
   because the `try_number` is not changed when the task is marked as `UP_FOR_SCHEDULE`,
   my ExternalTaskSensor with a `retries = 3` does not stop after 3 times and `on_failure_callback` never got called.
   (It ran until being marked as SUCCESS and the  `on_success_callback` got called).
   I think the cause is the below code. 
   ```
           # set state
           self.state = State.UP_FOR_RESCHEDULE
   
           # Decrement try_number so subsequent runs will use the same try number and write
           # to same log file.
           self._try_number -= 1
   ```
   https://github.com/apache/airflow/blob/main/airflow/models/taskinstance.py#L1673-L1678
   
   And IMHO, 👍 + 1 for
   > Option 1: Update or increase try_number after a task has been marked as up_for_reschedule, so that the log_id would be different by runs. This will probably solve some relevant issues from reschedule/try_number and log_id
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org