Cascading Failure Deep Dive: How a Months-Old Bug and One Router Took Down Email and Air Travel

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

Cascading Failure Deep Dive: How a Months-Old Bug and One Router Took Down Email and Air Travel

11月12日,微软365的电子邮件和协作服务在数十个国家中断了约一天。11月13日,美国联邦航空管理局(FAA)下令全美所有离港航班停飞超过四小时。官方表示,没有迹象表明这两起事件有关联,也均未被认定为网络攻击。但它们确实呈现出相似的形态:在这两起事件中,一个小型的局部故障因系统自身的反应机制而演变成了全系统的瘫痪。本文将根据初步公开的解释,分阶段梳理每次故障的过程,并将其映射到你可以应用于自身系统的防御措施中。在此先说明两点:两者的解释均为初步结论——微软的最终事故报告定于11月20日发布,而FAA尚未完成根本原因审查。此外,我并未参与这两起事件的内部处理,文中的所有内容均来自公开声明和报道(并已在文中注明引用来源)。

Part 1: Microsoft 365, November 12 to 13

第一部分:微软365,11月12日至13日

What happened Exchange Online and Outlook were hit hardest, with Teams, Copilot, SharePoint, and other services affected. Morningstar DBRS estimated insured losses of $300 million to $500 million. Microsoft’s preliminary post-incident report, covered by GeekWire, The Register, and BleepingComputer, describes a chain of events.

发生了什么 Exchange Online和Outlook受到的冲击最为严重,Teams、Copilot、SharePoint及其他服务也受到波及。晨星DBRS(Morningstar DBRS)估计保险损失在3亿至5亿美元之间。据GeekWire、The Register和BleepingComputer报道,微软的初步事故报告描述了一系列连锁反应。

Stage 1: a latent defect A fix rolled out to Microsoft 365’s networking gateway servers in July contained a defect. Under heavy load, it caused lock contention: threads waiting on each other for a shared lock, burning CPU and memory without doing useful work. Microsoft says the contention was inside an internal Windows process and got worse on newer machines with more cores. My reading is that more cores means more threads competing for the same lock. The defect sat in production for more than three months without causing an outage, because normal load never pushed the gateways into the state where contention ran away.

第一阶段:潜在缺陷 7月份向微软365网络网关服务器推送的一项修复程序包含一个缺陷。在高负载下,它导致了锁竞争(lock contention):线程为了争夺共享锁而相互等待,在不执行有效工作的情况下消耗CPU和内存。微软表示,这种竞争发生在Windows内部进程中,且在拥有更多核心的新型机器上表现得更为严重。我的理解是,更多的核心意味着更多的线程在争夺同一个锁。该缺陷在生产环境中存在了三个多月而未引发中断,因为正常负载从未将网关推向竞争失控的状态。

Stage 2: headroom erodes Two unrelated things removed the safety margin before the failure: About 14% of gateway capacity was already out of service because of an earlier, separate issue. Roughly 15 hours before the outage, according to GeekWire, Teams traffic had been moved onto the Exchange gateway pool. Neither was an incident on its own. Microsoft says the reduced capacity alone left enough headroom. The combination is what tipped the gateways into the defect. Microsoft also says its load testing tended to focus on weaker hardware with fewer cores than production.

第二阶段:冗余空间被侵蚀 在故障发生前,两件互不相关的事情消除了安全余量:由于之前一个独立的问题,约14%的网关容量已处于停用状态。据GeekWire报道,在中断发生前约15小时,Teams的流量被迁移到了Exchange网关池中。这两件事单独来看都不是事故。微软表示,仅容量减少尚留有足够的冗余空间,但两者的叠加导致网关触发了该缺陷。微软还表示,其负载测试往往侧重于比生产环境核心数更少的较弱硬件。

Stage 3: overload spreads through rerouting Once some gateways crossed into runaway contention and stopped responding, automatic rerouting did what it was designed to do: it moved their traffic to the healthy gateways. That extra load pushed those gateways into the same state. The failure spread until more than 80% of gateway servers were unresponsive. This is the classic shape of a cascading failure. The mechanism meant to contain a failure, moving work away from a broken node, spreads it when the cause is load itself.

第三阶段:过载通过重路由扩散 一旦部分网关陷入失控的竞争并停止响应,自动重路由机制便执行了其预设功能:将流量转移到健康的网关。额外的负载将这些网关也推向了同样的状态。故障不断扩散,直到超过80%的网关服务器失去响应。这是级联故障的典型形态:旨在遏制故障(将工作从损坏节点移走)的机制,在故障根源是负载本身时,反而起到了扩散作用。

Stage 4: recovery fights itself When engineers restarted servers, clients that had been failing all reconnected at once. The restarted servers were overwhelmed before they could stabilize, a pattern usually called a thundering herd. GeekWire’s summary of the report names it explicitly.

第四阶段:恢复过程中的自我博弈 当工程师重启服务器时,之前一直处于故障状态的客户端同时重新连接。重启后的服务器在稳定之前就被淹没,这种模式通常被称为“惊群效应”(thundering herd)。GeekWire对该报告的摘要中明确提到了这一点。

Stage 5: containment boundaries leak Microsoft’s design is meant to keep a problem in one region from spreading to others. The preliminary report says safeguards meant to keep a problem in one region didn’t hold, and it doesn’t yet explain why. That’s one of the details the final report should clarify. Microsoft resolved the outage by rolling out an update that reverted the defective change.

第五阶段:遏制边界失效 微软的设计旨在防止一个区域的问题扩散到其他区域。初步报告称,旨在将问题限制在单一区域的防护措施未能生效,但尚未解释原因。这是最终报告需要澄清的细节之一。微软通过推送更新回滚了有缺陷的变更,从而解决了此次中断。

Part 2: the FAA ground stop, November 13

第二部分:FAA地面停飞,11月13日

What happened Around 3:30 to 3:36 p.m. Eastern, air traffic controllers began seeing radar and radio inconsistencies. At 3:54 p.m., the FAA issued a nationwide ground stop. Instability reached 17 of the 22 Air Route Traffic Control Centers that manage high-altitude traffic, along with several approach control facilities. The stop was lifted at about 8:15 p.m. FedScoop reported it was only the second nationwide ground stop since 2001. The FAA’s own Q&A covers the basics.

发生了什么 美东时间下午3:30至3:36左右,空中交通管制员开始发现雷达和无线电数据不一致。下午3:54,FAA发布了全国范围的地面停飞令。不稳定状况波及了管理高空交通的22个空中航路交通管制中心中的17个,以及多个进近管制设施。停飞令于晚上8:15左右解除。据FedScoop报道,这是自2001年以来第二次全国性地面停飞。FAA的问答文档涵盖了基本情况。

Stage 1: a change at the edge L3Harris, which runs the FAA’s telecommunications network, was replacing copper circuits with fiber at an FAA site in El Dorado, Arkansas. A new router was installed as part of that work. AeroTime reports it was a Juniper unit replacing an older Cisco device. HPE, which owns Juniper, said the device functioned as it was configured to by the installer.

第一阶段:边缘侧的变更 负责运营FAA电信网络的L3Harris公司,正在阿肯色州埃尔多拉多(El Dorado)的一个FAA站点将铜缆电路更换为光纤。作为该工作的一部分,安装了一台新路由器。据AeroTime报道,这是一台用于替换旧款思科设备的Juniper设备。拥有Juniper的HPE公司表示,该设备的功能表现符合安装人员的配置。

Stage 2: one device floods a shared network The new router began generating connection attempts across the FAA’s telecommunications network. The FAA describes about 1,000 connection attempts every four to five seconds. Whether the cause was a configuration error or a faulty unit is still undetermined, according to Duffy.

第二阶段:单台设备淹没共享网络 新路由器开始在FAA的电信网络中产生连接请求。FAA描述称,每四到五秒钟就会产生约1000次连接尝试。据Duffy称,导致该问题的究竟是配置错误还是设备故障,目前尚无定论。

Stage 3: older equipment can’t absorb it Legacy equipment elsewhere on the network couldn’t handle the flood. Radar and communications feeds to most en-route centers degraded. A fault at one small site became a national event because the network was shared and the legacy equipment apparently couldn’t protect itself from a misbehaving peer.

第三阶段:旧设备无法承受冲击 网络中其他位置的遗留设备无法处理这种流量洪峰。通往大多数航路中心的雷达和通信馈线性能下降。一个小型站点的故障演变成全国性事件,原因在于网络是共享的,且遗留设备显然无法保护自身免受异常对等节点的干扰。

Stage 4: diagnosis is slow FAA Administrator Bryan Bedford said the agency spent about 45 minutes trying to find the cause without success before issuing the ground stop, partly because this kind of maintenance is logged by hand on paper (FedScoop). When you don’t have a fast, searchable record of what changed and where, the first hour of an incident goes to finding the change.

第四阶段:诊断缓慢 FAA局长Bryan Bedford表示,在发布停飞令之前,该机构花费了约45分钟试图寻找原因但未果,部分原因是此类维护工作是手工记录在纸上的(据FedScoop)。当你没有关于“什么在何处发生了变更”的快速、可搜索记录时,事故发生后的第一个小时往往都浪费在寻找变更点上。

Stage 5: isolation, then a fleet-wide fix Isolating the El Dorado router, and a second one at a site in Amarillo, Texas, stabilized the network. The FAA then disabled the suspect function on about 60 similar routers across its network. The FBI is examining the router at an L3Harris lab, which

第五阶段:隔离与全网修复 隔离了埃尔多拉多站点的路由器以及德克萨斯州阿马里洛(Amarillo)站点的第二台路由器后,网络恢复了稳定。随后,FAA禁用了其网络中约60台类似路由器上的可疑功能。FBI目前正在L3Harris的实验室检查该路由器,该路由器……