wolfier commented on issue #30264:
URL: https://github.com/apache/airflow/issues/30264#issuecomment-1646309988

   I believe the question is what does it mean when a dagrun times out. 
   
   If dagrun timeout means "I need everything to stop including the task 
instances" then forcing task termination is appropriate. I don't agree with 
setting the ending state as skipped if a task was in the running state since 
the task in the middle of execution.
   
   Looking at @RNHTTR's 
[PR](https://github.com/apache/airflow/pull/14321/files), I see the logic is to 
mark all tasks that are 
[unfinished](https://github.com/apache/airflow/blob/2.6.3rc1/airflow/utils/state.py#L158-L170)
 to skipped. 
   
   ```
               TaskInstanceState.SCHEDULED,
               TaskInstanceState.QUEUED,
               TaskInstanceState.RUNNING,
               TaskInstanceState.SHUTDOWN,
               TaskInstanceState.RESTARTING,
               TaskInstanceState.UP_FOR_RETRY,
               TaskInstanceState.UP_FOR_RESCHEDULE,
               TaskInstanceState.DEFERRED,
   ```
   
   Instead, I think it should be more refined.
   
   The scheduled and queued state should be set to skipped **IF** that was 
their first attempt (checking try number). Though this may not work for sensors 
that are rescheduled and are in the middle of being scheduled / queued.
   
   The rest of the states should be set to failed because they imply the task 
instance was attempted. Tasks that are attempted should be failed.


-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to