Skip to content

Add RandomizedDelaySec to cloudflared-update.timer - #1701

Open
RajeshRajendiran wants to merge 1 commit into
cloudflare:masterfrom
RajeshRajendiran:add-randomized-delay-update-timer
Open

Add RandomizedDelaySec to cloudflared-update.timer#1701
RajeshRajendiran wants to merge 1 commit into
cloudflare:masterfrom
RajeshRajendiran:add-randomized-delay-update-timer

Conversation

@RajeshRajendiran

@RajeshRajendiran RajeshRajendiran commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • Adds RandomizedDelaySec=12h and Persistent=true to the generated cloudflared-update.timer systemd unit.
  • Without this, OnCalendar=daily fires every replica at exactly 00:00:00, so fleets running multiple cloudflared instances for HA failover all pull the update and restart at the same instant, causing a brief total outage instead of a staggered rollout.

Test plan

  • go build ./cmd/cloudflared/...
  • go test -race ./cmd/cloudflared/...
  • gofmt -l / go vet ./cmd/cloudflared/...
  • make lint (golangci-lint in this sandbox is built against an older Go toolchain than this repo's go 1.26 and refuses to run; CI should cover this)

Fixes #1645

Fleets running multiple cloudflared instances for HA failover all pull
updates and restart at the same instant, since OnCalendar=daily fires
at exactly 00:00:00. Add a 12h randomized delay (and Persistent=true
to still catch missed runs) to the generated systemd timer so
replicas update at staggered times instead of simultaneously.

Fixes cloudflare#1645
@RajeshRajendiran
RajeshRajendiran force-pushed the add-randomized-delay-update-timer branch from 2d0c6b7 to 6bb3fb1 Compare July 26, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💡 Feature Request: Add randomized delay to auto-update timer to prevent simultaneous fleet-wide HA tunnel restarts

1 participant