You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add ping interval override for improved job pickup performance
Add --ping-interval CLI flag and BUILDKITE_AGENT_PING_INTERVAL environment
variable to override the server-specified ping interval. This enables faster
job pickup for performance-sensitive workloads like dynamic pipelines.
By default, agents poll every 10-20 seconds (server interval + jitter). With
this feature, users can reduce latency to 5-10 seconds or other custom intervals.
Includes safeguards and comprehensive testing:
- Minimum 2-second interval to prevent server overload (values below 2s are clamped with warning)
- Only integer values supported (floats like 2.5 are rejected with clear error)
- Comprehensive unit tests for validation logic and CLI configuration
- Clear documentation of constraints and behavior
BREAKING CHANGE: None. Feature is backward compatible - when ping-interval is
0 or unspecified, the agent uses the server-provided interval as before.
Changes:
- Add PingInterval field to AgentStartConfig and AgentConfiguration
- Add --ping-interval CLI flag with BUILDKITE_AGENT_PING_INTERVAL env var
- Extract determinePingInterval() method for testable validation logic
- Add comprehensive unit tests (TestAgentWorker_PingIntervalValidation, TestAgentStartConfig_PingInterval)
- Add minimum 2-second safeguard with warning for lower values
- Change ping interval logging from debug to info level for visibility
- Update documentation to clarify integer-only constraint and minimum value
- Add comprehensive documentation in CHANGELOG, README, and docs/
Co-Authored-By: Claude <[email protected]>
By default, agents poll for jobs every 10-20 seconds (server-specified interval plus random jitter). For performance-sensitive workloads like dynamic pipelines, you can reduce job pickup latency:
87
+
88
+
```bash
89
+
# Faster job pickup (5-10 seconds instead of 10-20 seconds)
@@ -380,6 +381,12 @@ var AgentStartCommand = cli.Command{
380
381
Usage: "The maximum uptime in seconds before the agent stops accepting new jobs and shuts down after any running jobs complete. The default of 0 means no timeout",
Usage: "Override the server-specified ping interval in seconds (integer values only). The default of 0 uses the server-provided interval. Minimum value is 2 seconds",
388
+
EnvVar: "BUILDKITE_AGENT_PING_INTERVAL",
389
+
},
383
390
cancelGracePeriodFlag,
384
391
cli.BoolFlag{
385
392
Name: "enable-job-log-tmpfile",
@@ -1033,6 +1040,7 @@ var AgentStartCommand = cli.Command{
0 commit comments