Implement background job heartbeat and stuck-job detection
Description
- Detect and surface stuck workers by tracking periodic job heartbeats.
Requirements and context
- Persist heartbeat timestamp and mark stale jobs after configurable threshold.
- Expose stale-job metric and alert-ready signal.
Suggested execution
- Update worker runtime to emit heartbeat at fixed interval.
- Add reconciliation process to mark and optionally requeue stale jobs.
Test and commit
- Add tests for heartbeat updates and stale detection transitions.
Example commit message
feat(jobs): add heartbeat tracking and stale job detection
Guidelines
- Avoid duplicate requeue for actively running jobs.
- Keep logic resilient to short network interruptions.
Implement background job heartbeat and stuck-job detection
Description
Requirements and context
Suggested execution
Test and commit
Example commit message
feat(jobs): add heartbeat tracking and stale job detectionGuidelines