You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/10 18:16:00 UTC

[jira] [Commented] (AIRFLOW-6535) add exception subclass to fail immediately without retrying

    [ https://issues.apache.org/jira/browse/AIRFLOW-6535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17013107#comment-17013107 ] 

ASF GitHub Bot commented on AIRFLOW-6535:
-----------------------------------------

jstern commented on pull request #7133: [AIRFLOW-6535] first pass at exception to fail without retry
URL: https://github.com/apache/airflow/pull/7133
 
 
   ---
   Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
   
   - [ ] Description above provides context of the change
   - [x] Commit message/PR title starts with `[AIRFLOW-NNNN]`. AIRFLOW-NNNN = JIRA ID<sup>*</sup>
   - [ ] Unit tests coverage for changes (not needed for documentation changes)
   - [?] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [ ] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   <sup>*</sup> For document-only changes commit message can start with `[AIRFLOW-XXXX]`.
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> add exception subclass to fail immediately without retrying
> -----------------------------------------------------------
>
>                 Key: AIRFLOW-6535
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-6535
>             Project: Apache Airflow
>          Issue Type: New Feature
>          Components: models
>    Affects Versions: master
>            Reporter: Jon Stern
>            Priority: Minor
>
> I would like to be able to configure certain tasks to retry, but to also have a way to bypass retry if I can detect a condition that is unlikely to be change for the better.
> For example, imagine I have a DAG with a large number of tasks that fetch data from an API ... sometimes the API returns a 200 and everything is fine, sometimes the API returns a 500 and I know this means that API is failing under load and I want to retry later, and sometimes the API returns a 400 indicating that I've configured my requests in a way that will never succeed. If the API returns a 400 for some/all of my tasks, then I have to wait for all of them to get through all their retries before the run fails.
> My proposal is to add another subclass of AirflowException called AirflowFailException, and to update the exception handling in TaskInstance.run_raw_task such that when this exception is seen, the resulting behavior is that same as if we entered handle_failure and is_eligible_for_returned false (except with adjusted logging so it does not look like we simply hit our retry limit). 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)