In distributed systems, failover is designed to contain failures. But when traffic redistribution, health-based ejection, and capacity constraints interact in the wrong way, failover can become the mechanism that propagates an outage.
The Microsoft 365 gateway incident highlights a particularly dangerous failure pattern: a cascading gateway ejection loop.
How the failure propagated
The incident involved a latent defect in the gateway code that had been present since July. Under specific traffic and gateway conditions, the defect contributed to a chain of failures that progressively reduced the available gateway capacity.
The failure loop can be understood as:
- Gateway degradation: Gateways begin experiencing performance issues and become less capable of handling incoming traffic.
- Health-based ejection: Health checks identify affected gateways and remove them from the serving pool.
- Traffic concentration: Requests are redistributed to the remaining healthy gateways.
- Capacity exhaustion: The surviving gateways absorb additional load and begin degrading.
- Secondary ejections: More gateways fail health checks and are removed.
- Cascading failure: The serving fleet progressively loses capacity as traffic concentrates across fewer available nodes.
At the low point, Microsoft's preliminary report indicated that more than 80% of the gateway fleet had become unresponsive.
Why this failure pattern is particularly dangerous
The problem isn't simply that individual gateways fail. It's the feedback loop between failure detection and traffic redistribution.
A health-based ejection mechanism may improve reliability when a node is isolated from the rest of the system. However, when ejection decisions are made without sufficient consideration of remaining fleet capacity, the system can inadvertently increase the load on nodes that are already operating under stress.
This creates a feedback loop in which:
- Reduced capacity increases load on surviving nodes.
- Increased load degrades those nodes.
- Degradation triggers additional ejections.
- Additional ejections further reduce capacity.
The failure-handling mechanism becomes part of the propagation path.
Key engineering lessons
- Ejection policies need guardrails: Health-based removal should account for the impact on remaining fleet capacity.
- Capacity-aware traffic redistribution matters: Moving traffic is not equivalent to having capacity to serve it.
- Recovery is a controlled process: Reintroducing nodes without managing traffic ramp-up can re-trigger instability.
- Health checks need context: Node health should be evaluated in a way that avoids cascading reactions to transient overload.
- Failure mechanisms need failure testing: Load balancing, health checks, retries, ejection policies and recovery logic should be tested together under degraded capacity scenarios.
Resilience isn't simply about detecting unhealthy nodes and moving traffic elsewhere. It's about ensuring that the system's response to a failure doesn't amplify it.
The most critical question in designing resilient distributed systems is often not how quickly a failing component can be removed, but how the rest of the system behaves when that removal happens.
🔎 Full postmortem here: https://buildopsy.com/system-design/microsoft-365-gateway-ejection-loop-postmortem.html:

Top comments (0)