XD-DENG commented on a change in pull request #4919: [AIRFLOW-4093] Add
exception if job failed or cancelled or retry too many times
URL: https://github.com/apache/airflow/pull/4919#discussion_r265856507
##########
File path: airflow/contrib/hooks/aws_athena_hook.py
##########
@@ -127,14 +127,21 @@ def poll_query_status(self, query_execution_id,
max_tries=None):
elif query_state in self.INTERMEDIATE_STATES:
self.log.info('Trial {try_number}: Query is still in an
intermediate state - {state}'
.format(try_number=try_number,
state=query_state))
+ elif query_state in self.FAILURE_STATES:
+ self.log.error('Trial {try_number}: Query is failed - {state}'
+ .format(try_number=try_number,
state=query_state))
+ raise Exception('Athena job
{state}.'.formate(state=query_state))
Review comment:
If you raise the Exception here, no retry will be "retried" ;-) The logic
here will be broken.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services