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/02/07 16:33:56 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6870: [AIRFLOW-0578] Check return code

ashb commented on a change in pull request #6870: [AIRFLOW-0578] Check return code
URL: https://github.com/apache/airflow/pull/6870#discussion_r376487438
 
 

 ##########
 File path: airflow/jobs/local_task_job.py
 ##########
 @@ -95,6 +95,14 @@ def signal_handler(signum, frame):
                 # Monitor the task to see if it's done
                 return_code = self.task_runner.return_code()
                 if return_code is not None:
+                    if return_code != 0:
+                        self.task_instance.refresh_from_db()
+                        # there is one case we should not treat non zero return
+                        # code as failed: the job has been killed externally.
+                        if (not self.terminating) or self.task_instance.state == State.FAILED:
 
 Review comment:
   How does `state="failed"` relate to job been killed externally?
   
   I'm also not that happy about having very similar conditions here and inside on_failure. And again: Why throw an exception only to have it caught later, why not just call `self.on_failure`?

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