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 2020/01/10 18:38:47 UTC

[GitHub] [airflow] jstern edited a comment on issue #7133: [AIRFLOW-6535] first pass at exception to fail without retry

jstern edited a comment on issue #7133: [AIRFLOW-6535] first pass at exception to fail without retry
URL: https://github.com/apache/airflow/pull/7133#issuecomment-573155093
 
 
   One other question: am I perhaps overcomplicating this? It occurs to me that if a task encounters an AirflowSkipException, we don't bother checking on its retry status or adjusting our messaging based on that:
   
   ```python
           except AirflowSkipException as e:
               # Recording SKIP
               # log only if exception has any arguments to prevent log flooding
               if e.args:
                   self.log.info(e)
               self.refresh_from_db(lock_for_update=True)
               self.state = State.SKIPPED
               self.log.info(
                   'Marking task as SKIPPED.'
                   'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
                   self.dag_id,
                   self.task_id,
                   self.execution_date.strftime('%Y%m%dT%H%M%S') if hasattr(
                       self,
                       'execution_date') and self.execution_date else '',
                   self.start_date.strftime('%Y%m%dT%H%M%S') if hasattr(
                       self,
                       'start_date') and self.start_date else '',
                   self.end_date.strftime('%Y%m%dT%H%M%S') if hasattr(
                       self,
                       'end_date') and self.end_date else '')
   ```
   
   Maybe instead of messing with handle_failure I should just emulate that but with different messaging? Might be cleaner and easier to follow...
   
   EDIT: but then I would still need to make sure failure email/callbacks happen ... so I guess I can either leave this structured the way I have it or include those in the except block.

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


With regards,
Apache Git Services