kaxil commented on issue #14422:
URL: https://github.com/apache/airflow/issues/14422#issuecomment-821222484


   @houqp This is what I had suggested on call with @ephraimbuddy few days back 
to add `self.handle_task_exit(1)`
   
   ```diff
     def signal_handler(signum, frame): 
         """Setting kill signal handler""" 
         self.log.error("Received SIGTERM. Terminating subprocesses") 
         self.on_kill() 
   +    self.handle_task_exit(1)
         raise AirflowException("LocalTaskJob received SIGTERM signal") 
   ```
   
   However, that didn't work coz `_run_finished_callback`` didn't run anything 
since the Task state was still RUNNING. We should probably add 
`self.task_instance.state=State.FAILED` in `handle_task_exit` if `exit_code != 
1`. WDYT  @houqp  @ephraimbuddy  ?
   
   
https://github.com/apache/airflow/blob/e7c642ba2a79ea13d6ef84b78242f6c313cd3457/airflow/jobs/local_task_job.py#L144-L153
   
   
https://github.com/apache/airflow/blob/e7c642ba2a79ea13d6ef84b78242f6c313cd3457/airflow/models/taskinstance.py#L1355-L1378


-- 
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:
us...@infra.apache.org


Reply via email to