dstandish commented on code in PR #27758:
URL: https://github.com/apache/airflow/pull/27758#discussion_r1068668177
##########
airflow/jobs/triggerer_job.py:
##########
@@ -87,19 +241,29 @@ def on_kill(self):
"""
self.runner.stop = True
+ def _kill_listener(self):
+ if self.listener:
+ for h in self.listener.handlers:
+ h.close()
+ self.listener.stop()
+
def _exit_gracefully(self, signum, frame) -> None:
"""Helper method to clean up processor_agent to avoid leaving orphan
processes."""
# The first time, try to exit nicely
if not self.runner.stop:
self.log.info("Exiting gracefully upon receiving signal %s",
signum)
self.runner.stop = True
+ self._kill_listener()
else:
self.log.warning("Forcing exit due to second exit signal %s",
signum)
Review Comment:
i believe at this point kill lis has already been called. now we're getting
a second signal to kill forcibly. i suspect outcome is uncertain in that case
--
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]