You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "joshuaghezzi (via GitHub)" <gi...@apache.org> on 2023/02/20 22:12:24 UTC

[GitHub] [airflow] joshuaghezzi opened a new issue, #29648: Optionally exclude task deferral time from overall runtime of the task

joshuaghezzi opened a new issue, #29648:
URL: https://github.com/apache/airflow/issues/29648

   ### Description
   
   Ability to optionally exclude the time that the task was deferred from the overall execution time of the task.
   
   ### Use case/motivation
   
   I've created a custom operator which defers execution for a specified amount of time when a specific exception occurs. The task that uses the operator has a timeout on it which is less than the duration of the deferral so once the deferral resumes the task will timeout. Instead of raising the timeout to account for the time the task could be deferred which changes the intent of the timeout, I feel it'd useful to optionally exclude the time the task was deferred. The execution time would essentially be paused while the task is deferred and would start from where it was paused once the task resumes.
   
   ### Related issues
   
   #19382 - brought expected behaviour in line with documentation.
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.apache.org

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


[GitHub] [airflow] boring-cyborg[bot] commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1437605958

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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


[GitHub] [airflow] joshuaghezzi closed issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "joshuaghezzi (via GitHub)" <gi...@apache.org>.
joshuaghezzi closed issue #29648: Optionally exclude task deferral time from overall runtime of the task
URL: https://github.com/apache/airflow/issues/29648


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


[GitHub] [airflow] potiuk commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1437654137

   Maybe, but this would not be accurate - there are lots of nuances - when the task start running and when it is already deferred (both bringing back and deferring tasks take time). Plus it would require DB changes to keep the total time of "execution". CC: @andrewgodwin WDYT?


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


[GitHub] [airflow] joshuaghezzi commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "joshuaghezzi (via GitHub)" <gi...@apache.org>.
joshuaghezzi commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1437787575

   As an alternative and maybe simpler feature it'd also suit my use case if we could make it so that we are optionally able to "reset" the execution timer when the task resumes from deferral.  Does that sound more reasonable?


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


[GitHub] [airflow] potiuk commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1438000722

   I am inclined to close it as "won't do" :)


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


[GitHub] [airflow] potiuk commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1437918635

   > As an alternative and maybe simpler feature it'd also suit my use case if we could make it so that we are optionally able to "reset" the execution timer when the task resumes from deferral. Does that sound more reasonable?
   
   Not really - because the task can be resumed from deferral for different reasons. Many od the deferred tasks will have several different  resumable functions - and might go through different stages.  For example they can run few times resume in function a, different number of times in function b (both quick usually) , then they can run for a long time in function c and then make another several times resume in function d (also quick usually).
   
   Each of those resumed runs would have different expectations on how long they can run on its own - some of the checks will be quick. some of them might take longer.  So if you would like to have timeout separately for ach resume, you would have to add a feature of having different timeout configured for each resumed function. And that get's rather complex to configure, manage, and to keep control of. 
   
   I think the cumulative time is the only "reasonable" approach but as @andrewgodwin confirmed - it's non-trivial and inconsistent with sensors. 


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


[GitHub] [airflow] joshuaghezzi commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "joshuaghezzi (via GitHub)" <gi...@apache.org>.
joshuaghezzi commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1438023127

   Thanks a lot for the input @andrewgodwin and @potiuk. Happy to close this one as won't do. 


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


[GitHub] [airflow] andrewgodwin commented on issue #29648: Optionally exclude task deferral time from overall runtime of the task

Posted by "andrewgodwin (via GitHub)" <gi...@apache.org>.
andrewgodwin commented on issue #29648:
URL: https://github.com/apache/airflow/issues/29648#issuecomment-1437917495

   Yes, the changes required here are non-trivial - you'd need some sort of extra column to track cumulative runtime and then have the workers add values to that whenever they finished running a task section.
   
   Even if we could track such timing, I'd hesitate to then make timeouts use it, as that's breaking a core assumption about how those work - would we apply the same logic to rescheduling sensors, which act the same way as deferred operators? 


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