potiuk commented on issue #37971:
URL: https://github.com/apache/airflow/issues/37971#issuecomment-1984702476

   Are you sure @kosteev  ? 
   
   From what I see it is used n Job's `perform_heartbeat` method::
   
   ```
   def perform_heartbeat(
       job: Job, heartbeat_callback: Callable[[Session], None], 
only_if_necessary: bool
   ) -> None:
       """
       Perform heartbeat for the Job passed to it,optionally checking if it is 
necessary.
   
       :param job: job to perform heartbeat for
       :param heartbeat_callback: callback to run by the heartbeat
       :param only_if_necessary: only heartbeat if it is necessary (i.e. if 
there are things to run for
           triggerer for example)
       """
       seconds_remaining: float = 0.0
       if job.latest_heartbeat and job.heartrate: # <--- HERE THE HEARTRATE IS 
USED FROM JOB (and one level down)
           seconds_remaining = job.heartrate - (timezone.utcnow() - 
job.latest_heartbeat).total_seconds()
       if seconds_remaining > 0 and only_if_necessary:
           return
       job.heartbeat(heartbeat_callback=heartbeat_callback)
   ```
   
   I believe there were some fixes after 2.6.3 that fixed bad threshold 
calculations for some jobs (It was confusing whether the job used 2.1* 
multiplier or whether you had)  but I'd expect heartrate was not affected - 
maybe threshold is (or rather was) calculated wrongly.
   
   Also this scenario:
   
   ```
   1. run Airflow
   2. set [scheduler]job_heartbeat_sec with the value greater than 
[scheduler]scheduler_health_check_threshold
   3. see warning message in Airflow UI that scheduler is not alive
   ```
   
   is expected. If heartbeat sec is greater than threshold, then yes you'd 
expect to see the warning (the warning is issued when the heartbeat does not 
arrive in the threshold time - which would be exactly what is happening if 
those values are set as described). 
   
   Mybe the reproduction scenario is wrong? Could you please clarify ?
   
   
   


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