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



##########
File path: airflow/jobs/local_task_job.py
##########
@@ -80,14 +80,15 @@ def signal_handler(signum, frame):
             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(  # pylint: 
disable=protected-access
-                error="task received sigterm"
-            )
+            if self.task_instance.state == State.RUNNING:
+                # This only happens when a pod is deleted
+                # killing the task_runner by sending sigterm.
+                # TI sigterm is handled at taskinstance.py
+                self.handle_task_exit(128 + signum)

Review comment:
       @ashb The test I had previously for sigterm was not hitting here. I'm 
only able to hit here when I delete a running kubernetes pod. I wonder how we 
can test this?




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


Reply via email to