lucafuji commented on issue #6870: [AIRFLOW-0578] Check return code
URL: https://github.com/apache/airflow/pull/6870#issuecomment-575816844
 
 
   I just added python operator calls os._exit(1). My code does catch it and 
change the status to FAILED. without my code. The failure is not caught.
   
   **However**, we probably don't want use to call os._exit() in Python 
operator. This is because:
   Python operator runs in the same process with task instance. Therefore when 
calling os._exit, some post execution code in task instance is not executed. 
This will leave task instance in RUNNING state forever. 
   
   Here is the code of pose execution of task_instance:
   
https://github.com/apache/airflow/blob/master/airflow/models/taskinstance.py#L965

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

Reply via email to