Stateful WebSocket scale-in without drain
warningstateful-websocket-scale-in-without-drain
Scaling a gateway down kills every live WebSocket on the removed instance at once. Without a drain step those clients all reconnect together.
- Severity
- warning
- 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's `autoscaling` is true
- — the node's `drainOnScaleIn` is false
Realtime gateway '{{node.id}}' autoscales but does not drain connections on scale-in. Every scale-down becomes a reconnect storm.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 # Autoscaling down a gateway that holds live WebSockets kills every connection on the # removed instance at once. Without a drain step the clients all reconnect together. # Tripped by: designs/slack-messaging.broken.yaml schemaVersion: "1" type: "rule" id: "stateful-websocket-scale-in-without-drain" severity: "warning" select: node: kind: "realtime-gateway" when: all: - prop: "autoscaling" equals: true - prop: "drainOnScaleIn" equals: false message: "Realtime gateway '{{node.id}}' autoscales but does not drain connections on scale-in. Every scale-down becomes a reconnect storm."