Agent-Hellboy / Agent-Hellboy/mcp-runtime

fix(mcp-gateway): add jitter to policy reload ticker to prevent thundering herd

Aperta
#304 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
6
Fork
1
Merge medio
11h 33m
PR unite (30g)
13

Descrizione

## Problem
All gateway replicas start a `time.NewTicker(5 * time.Second)` at process start. With many MCPServer pods they all hit the Kubernetes ConfigMap API at the same wall-clock tick, creating a thundering herd every 5 seconds.

## Fix
Add up to 2s of random jitter to the ticker interval in `policy_cache.go`:

```go
jitter := time.Duration(rand.N(2000)) * time.Millisecond
ticker := time.NewTicker(5*time.Second + jitter)
```

## Files
- `services/mcp-gateway/policy_cache.go`

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.