知识卡片

普通读书笔记卡 · 3452

服务故障沿调用链传播

理解等级:中级

一次订单可能连续调用订单、支付、厨房和配送服务;链上任一请求超时或失败,都可能让后续步骤停住,甚至使订单状态不一致。容错设计需针对实际失败点定义重试、终止或对用户说明的行为,端到端测试也应覆盖这些分支。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 1 章《What are microservice APIs?》(源文件:_epub-src/OEBPS/Text/01.htm) - 结论依据:1.3.3 节给出订单至支付、厨房、配送的调用链,并明确说服务未按预期响应可触发级联错误,令订单未处理或状态不一致;图注提出重试或有意义回应,正文要求测试失败场景。 - 原始内容:In this complex chain of requests, if one of the services involved fails to respond as expected, it can trigger a cascading error through the platform that leaves the order unprocessed or in an inconsistent state. For this reason, it is important to design microservices so that they can deal reliably with failing endpoints. Our end-to-end tests should consider these scenarios and test the behavior of our services in those situations.