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
What it checks

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
Message
Realtime gateway '{{node.id}}' calls a coordination service synchronously on connect but has no reconnect stampede guard.

{{node.id}} style paths are filled in from the node, the edge or the design the finding is about.

Applies to · 20 components
Tripped by · 5

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.

Source
# 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."

The same page as markdown, for an agent: /catalogue/rules/reconnect-stampede-without-guard.md