Job Heartbeat - ja-guzzle/guzzle_docs GitHub Wiki

Overview

Guzzle has implemented job heartbeat mechanism to clean runaway sessions from guzzle. When the cluster is stopped by the user or it is crashed at that time, Guzzle Job terminates abnormally and it is stuck in RUNNING state and job status will never update to SUCCESS or FAILED. So to clean those running jobs we have added job heartbeat at the job level.

Workflow

To clean all the runaway sessions, Guzzle performs below three steps.

  • When Guzzle Job starts, It adds heartbeat entry in a repo and updates it at every 5 seconds interval until the job completes its execution.
  • Guzzle Api synchronize RUNNING Jobs with their last updated heartbeat entry at every 10 seconds.
  • If last updated heartbeat is before 1 minute from now then Guzzle API will mark that job as ABORTED.

Configuration

All the above interval configuration is externalised so, a user can configure it as per requirement in guzzle.yml and application.yml

heartbeat interval configuration in guzzle.yml

guzzle: 
  job_heartbeat:
    heartbeat_update_interval: "5000"
    job_aborted_timeout: "60000"

synchronize job status configuration in application.yml

application:
  jobHeartbeat:
    jobStatusCheckInterval: "10000"
⚠️ **GitHub.com Fallback** ⚠️