Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a warning log when worker heartbeats are sent later than expected, to help diagnose CPU contention / scheduling delays impacting worker liveness signaling.
Changes:
- Introduces a
heartbeatIntervalconstant in the heartbeat goroutine. - Logs a warning when the measured heartbeat interval exceeds a threshold (20% over expected).
- Updates heartbeat timing to reuse the captured
nowtimestamp forlastHeartbeat.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // detect heartbeat delays caused by CPU contention or other scheduling issues | ||
| actualInterval := now.Sub(lastHeartbeat) | ||
| if actualInterval > heartbeatInterval*6/5 { | ||
| a.l.Warn().Msgf( | ||
| "worker %s heartbeat interval delay (%s >> %s), possible CPU resource contention", |
There was a problem hiding this comment.
This delay warning will always trigger on the first heartbeat: lastHeartbeat is initialized 5s in the past to force an immediate send, so actualInterval will be ~5s (> 4s*6/5). Consider initializing lastHeartbeat to time.Now().UTC().Add(-heartbeatInterval) (or -heartbeatInterval-ε) or gating the warning until after the first successful heartbeat to avoid a startup false-positive.
|
📝 Documentation updates detected! New suggestion: Document Go SDK heartbeat delay warnings in troubleshooting guide Tip: Assign suggestions to team members in the Promptless dashboard to claim work 👥 |
Description
Adds a log warning if heartbeats are delayed due to cpu contention.
Type of change