Skip to content

fix: throttle cache synchronization to prevent API call feedback loop#80

Merged
shess-macu merged 1 commit intocyclops-k8s:mainfrom
shess-macu:shess/fixcachesyncoverlap
Apr 19, 2026
Merged

fix: throttle cache synchronization to prevent API call feedback loop#80
shess-macu merged 1 commit intocyclops-k8s:mainfrom
shess-macu:shess/fixcachesyncoverlap

Conversation

@shess-macu
Copy link
Copy Markdown
Contributor

SynchronizeCachesAsync was running on every heartbeat check interval (1s), causing thousands of HostnameCache API calls per minute. Each sync lists ClusterCache and HostnameCache CRDs, and any save triggers the DNS reconciler which lists them again — creating a feedback loop that never reaches quiescence.

Changes:

  • Decouple cache sync from heartbeat loop with a separate CacheSyncInterval (default 30s), configurable via values.yaml
  • Skip sync if one is already in progress (non-blocking WaitOne) instead of queuing callers
  • Force immediate sync only when a cluster is actually removed
  • Increase DNS probe timeouts from 1s to 5s

SynchronizeCachesAsync was running on every heartbeat check interval (1s),
causing thousands of HostnameCache API calls per minute. Each sync lists
ClusterCache and HostnameCache CRDs, and any save triggers the DNS
reconciler which lists them again — creating a feedback loop that never
reaches quiescence.

Changes:
- Decouple cache sync from heartbeat loop with a separate CacheSyncInterval
  (default 30s), configurable via values.yaml
- Skip sync if one is already in progress (non-blocking WaitOne) instead of
  queuing callers
- Force immediate sync only when a cluster is actually removed
- Increase DNS probe timeouts from 1s to 5s
@shess-macu shess-macu merged commit 4b809eb into cyclops-k8s:main Apr 19, 2026
2 checks passed
@shess-macu shess-macu deleted the shess/fixcachesyncoverlap branch April 19, 2026 18:21
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.

2 participants