ephraimbuddy commented on a change in pull request #16301:
URL: https://github.com/apache/airflow/pull/16301#discussion_r675323258



##########
File path: airflow/jobs/local_task_job.py
##########
@@ -79,11 +79,7 @@ def signal_handler(signum, frame):
             """Setting kill signal handler"""
             self.log.error("Received SIGTERM. Terminating subprocesses")
             self.on_kill()
-            self.task_instance.refresh_from_db()
-            if self.task_instance.state not in State.finished:
-                self.task_instance.set_state(State.FAILED)
-            self.task_instance._run_finished_callback(error="task received 
sigterm")
-            raise AirflowException("LocalTaskJob received SIGTERM signal")
+            self.handle_task_exit(128 + signum)

Review comment:
       Instead of writing 143, which is sigterm exit code, I divided it so I 
can use signum to show where the code comes from. Also see this
   https://tldp.org/LDP/abs/html/exitcodes.html
   
   I can write it 143 if it’s better




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to