improvement: decrease gateway health check interval for HA#231
improvement: decrease gateway health check interval for HA#231saifsmailbox98 wants to merge 1 commit into
Conversation
Companion to the backend/frontend change that lowers the heartbeat timeout from 1 hour to 5 minutes for faster gateway health detection in load balancing and HA deployments.
|
💬 Discussion in Slack: #pr-review-cli-231-improvement-decrease-gateway-health-check-interval-for-ha Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
LGTM — straightforward interval constant change to enable faster dead-gateway detection.
Extended reasoning...
Overview
This PR changes a single constant in packages/gateway-v2/gateway.go: the regular heartbeat ticker in registerHeartBeat goes from 30 * time.Minute to 3 * time.Minute, with the adjacent comment updated to match. No other logic or control flow is affected.
Security risks
None. The heartbeat call (api.CallGatewayHeartBeatV2) and authentication path are unchanged — only the cadence of an already-existing authenticated call is increased. No new endpoints, code paths, or data exposure.
Level of scrutiny
Low. This is a tuning parameter change motivated by HA / pool load balancing requirements documented in the linked companion backend PR (Infisical/infisical#6432). The trade-off (≈10× more heartbeat traffic per gateway) is a routine operational decision the team has explicitly made.
Other factors
- Phase 1 retry behavior (10s until first success) is untouched, so startup semantics don't change.
- The Phase 2 ticker is the only consumer of this value; no other code references the old 30-minute interval.
- No tests required for a constant change of this nature.
Description 📣
Reduces gateway heartbeat interval from 30 min to 3 min so the backend can detect dead gateways within 5 minutes for pool load balancing.
Companion Infisical PR: Infisical/infisical#6432
Type ✨
Tests 🛠️
# Here's some code block to paste some code snippets