Reconnect stampede without guard
errorreconnect-stampede-without-guard
When a gateway holding millions of sockets restarts, every client reconnects at once and the gateway asks the coordination service about each of them. Without a stampede guard that lookup storm takes the coordination service down too.
- Severity
- error
- Selects
- every node of kind realtime-gateway
- Components in scope
- 20
It looks at every node of kind realtime-gateway, and fires when:
- — all of these hold:
- — the node has at least one synchronous outgoing edge to a coordination-service
- — the node's `stampedeGuard` is false
Realtime gateway '{{node.id}}' calls a coordination service synchronously on connect but has no reconnect stampede guard.Reference designs whose broken twin names this rule in its header. The gate reads the same header, and fails when a rule no design trips.
# yaml-language-server: $schema=../schema/rule.schema.json # When a gateway holding millions of sockets restarts, every client reconnects at once # and the gateway hits the coordination service (discovery, ring lookup) for each of them. # Without a stampede guard (jittered reconnect, connection admission) that lookup storm # takes the coordination service down with it. # Tripped by: designs/slack-messaging.broken.yaml schemaVersion: "1" type: "rule" id: "reconnect-stampede-without-guard" severity: "error" select: node: kind: "realtime-gateway" when: all: - hasEdge: direction: "out" mode: "sync" peerKind: "coordination-service" - prop: "stampedeGuard" equals: false message: "Realtime gateway '{{node.id}}' calls a coordination service synchronously on connect but has no reconnect stampede guard."