RNHTTR commented on code in PR #41704:
URL: https://github.com/apache/airflow/pull/41704#discussion_r1729545497
##########
airflow/jobs/local_task_job_runner.py:
##########
@@ -208,9 +208,16 @@ def sigusr2_debug_handler(signum, frame):
if span.is_recording():
span.add_event(name="perform_heartbeat")
- perform_heartbeat(
- job=self.job,
heartbeat_callback=self.heartbeat_callback, only_if_necessary=False
- )
+ try:
+ perform_heartbeat(
+ job=self.job,
heartbeat_callback=self.heartbeat_callback, only_if_necessary=False
+ )
+ except Exception as e:
+ # Failing the heartbeat should never kill the
localtaskjob
+ # If it repeatedly can't heartbeat, it will be marked
as a zombie anyhow
+ warn_string = f"Heartbeat failed with Exception: {e}"
+ self.log.warning(warn_string)
+ pass
Review Comment:
No need for pass at this point
##########
airflow/jobs/local_task_job_runner.py:
##########
@@ -208,9 +208,16 @@ def sigusr2_debug_handler(signum, frame):
if span.is_recording():
span.add_event(name="perform_heartbeat")
- perform_heartbeat(
- job=self.job,
heartbeat_callback=self.heartbeat_callback, only_if_necessary=False
- )
+ try:
+ perform_heartbeat(
+ job=self.job,
heartbeat_callback=self.heartbeat_callback, only_if_necessary=False
+ )
+ except Exception as e:
+ # Failing the heartbeat should never kill the
localtaskjob
+ # If it repeatedly can't heartbeat, it will be marked
as a zombie anyhow
+ warn_string = f"Heartbeat failed with Exception: {e}"
Review Comment:
Logging shouldn't use f-strings
https://docs.astral.sh/ruff/rules/logging-f-string/#:~:text=Using%20f%2Dstrings%20to%20format,argument%20defers%20formatting%20until%20required.
--
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]