[Eval][v3][zh] Third-party payment gateway timeouts cascade into checkout outage
service: checkout-svccreated: 6/2/2026, 11:59:40 PM
Raw incident context
Time: 18:40 UTC. checkout-svc starts returning HTTP 504 to ~78% of checkout attempts. Symptoms: - p99 latency: 28s (hitting our 30s gateway timeout) - Success rate: 22% (down from 99.5%) - Thread pool utilization: 100% (all 200 worker threads blocked) - Inbound queue depth: 4200 requests (queue limit 5000) Downstream calls (from APM): - Stripe Connect API (/v1/payment_intents): p99 jumped from 800ms to 27s - Stripe status page: "Investigating elevated latency for Connect endpoints in us-east-1" (posted 18:35 UTC) - All other downstream deps (auth-svc, fraud-svc) normal Our config: - Stripe call timeout: 30s (matches inbound) - No circuit breaker on Stripe client - No bulkhead — Stripe calls share the main worker thread pool Customer impact: - Failed checkouts: ~3000 in 5min - Estimated lost GMV: $180k (so far) On-call: - 18:38 — pager - 18:41 — confirmed Stripe is the culprit (status page + APM) - 18:43 — debating: wait it out vs disable Stripe path entirely
Summary
结账服务 checkout-svc 因下游 Stripe Connect API 延迟飙升导致线程池耗尽,成功率从 99.5% 骤降至 22%,p99 延迟达到 28 秒(接近 30 秒超时),约 3000 笔交易失败,预计损失 GMV 18 万美元。
Severity reasoning: 用户可见的结账失败率高达 78%,超过 1% 阈值且持续超过 5 分钟;收入路径(支付)完全中断,符合 SEV1 定义。
deepseek-chat·prompt v3·output: zh·11535ms·2413↑ / 1771↓ tok·$0.00260
Root cause hypotheses
- highStripe Connect API 在 us-east-1 区域出现延迟飙升,导致 checkout-svc 的 HTTP 调用阻塞线程池。
Evidence: APM 显示 Stripe /v1/payment_intents 的 p99 从 800ms 升至 27s;Stripe 状态页确认 'Investigating elevated latency for Connect endpoints in us-east-1'(18:35 UTC)。
- highcheckout-svc 未对 Stripe 调用设置熔断器或隔离机制,导致单个下游故障耗尽所有工作线程。
Evidence: 配置中无 circuit breaker,且 Stripe 调用与主线程池共享(无 bulkhead),线程池利用率 100%,入队队列深度 4200。
- mediumStripe 调用超时设置(30s)与网关超时一致,导致请求在超时前长时间占用线程。
Evidence: 配置显示 Stripe 调用超时 30s,与 inbound 网关超时相同,线程被阻塞直至超时。
- lowStripe 客户端连接池耗尽,导致新请求排队等待连接。
Evidence: 无直接证据,但线程池耗尽时连接池也可能成为瓶颈。
Investigation checklist
- 确认 Stripe 延迟是否仍在持续
curl -w '%{time_total}' -o /dev/null -s https://api.stripe.com/v1/payment_intents -H 'Authorization: Bearer sk_test_xxx'Expected: 响应时间应 < 1s;若 > 5s 则 Stripe 仍异常
- 检查线程池和队列深度
curl http://checkout-svc:8080/actuator/health | jq '.threadPool'Expected: activeThreads < 200,queueDepth 接近 0
- 查看 Stripe 调用超时日志
kubectl logs -n prod -l app=checkout-svc --since=10m | grep -i 'stripe.*timeout' | tail -20Expected: 大量 'timeout' 日志,确认超时是主要错误
- 检查 Stripe 客户端连接池状态
kubectl exec -n prod deploy/checkout-svc -- curl -s localhost:8080/actuator/metrics/http.client.requests | jq '.measurements[0].value'Expected: 连接数应接近配置的最大值,若持续增长则连接池耗尽
Mitigation plan
启用熔断器:在 Stripe 客户端配置熔断器,失败率达到 50% 时快速失败,避免线程池耗尽。
Risk: 熔断后所有支付请求立即失败,但可保护线程池;需确保熔断器半开恢复机制。
Rollback: 移除熔断器配置或设置阈值为 100%
降级 Stripe 支付路径:临时禁用 Stripe 支付,仅保留其他支付方式(如 PayPal)。
Risk: 部分用户无法使用信用卡支付,但可保留结账功能;需确认其他支付方式正常。
Rollback: 重新启用 Stripe 支付
降低 Stripe 调用超时:从 30s 降至 5s,减少线程阻塞时间。
Risk: 部分正常请求可能因超时过短而失败,但可缓解线程池压力。
Rollback: 恢复超时为 30s
Customer impact
约 78% 的结账尝试失败,用户看到 HTTP 504 错误或超时。过去 5 分钟内约 3000 笔交易失败,预计损失 GMV 18 万美元。已确认 Stripe 支付服务异常,其他支付方式可能正常。
Postmortem draft
事后复盘
摘要
[FILL IN] 2023-xx-xx 18:40 UTC,checkout-svc 因下游 Stripe Connect API 延迟飙升导致线程池耗尽,成功率从 99.5% 降至 22%,影响持续约 [FILL IN] 分钟。
时间线(UTC)
- 18:35 Stripe 状态页发布延迟问题
- 18:38 收到告警
- 18:41 确认 Stripe 为根因
- 18:43 讨论降级方案
- [FILL IN] 实施熔断器
- [FILL IN] 恢复
影响
- 失败结账:约 3000 笔
- 损失 GMV:约 $180k
- 影响用户:约 [FILL IN] 人
根因
Stripe Connect API 在 us-east-1 区域延迟飙升,checkout-svc 缺乏熔断器和线程隔离,导致所有工作线程被阻塞。
检测
APM 和 Stripe 状态页及时提供了信号,但告警延迟了 3 分钟。
响应
- 快速识别根因
- 降级决策耗时较长
做得好的
- 及时查看 Stripe 状态页
- APM 数据清晰
做得不好的
- 无熔断器
- 无线程隔离
- 超时设置过长
行动项
- [ ] 为 Stripe 客户端添加熔断器(P0)
- [ ] 实现 bulkhead 隔离(P0)
- [ ] 缩短 Stripe 超时(P1)
- [ ] 增加降级自动化(P1)
Follow-ups
- P0为 Stripe 客户端添加熔断器,配置失败率阈值和半开恢复— 支付平台团队
- P0实现线程池隔离(bulkhead),将 Stripe 调用与主线程池分离— 平台工程团队
- P1缩短 Stripe 调用超时至 5s,并评估对正常请求的影响— 支付平台团队
- P1增加自动降级机制:检测到下游故障时自动切换支付方式— SRE 团队
- P2完善告警规则:增加线程池利用率 > 80% 的告警— 可观测性团队
Similar past incidents
lexical match (pg_trgm)
- 70%
[Eval][v2][zh] Third-party payment gateway timeouts cascade into checkout outage
Checkout success rate dropped from 99.5% to 22%, p99 latency 28s (hitting 30s timeout), thread pool exhausted
- 65%
[Eval][v1][zh] Third-party payment gateway timeouts cascade into checkout outage
Checkout success rate dropped from 99.5% to 22%, p99 latency 28s (hitting 30s timeout), thread pool exhausted
- 50%
[Eval][v1][en] Third-party payment gateway timeouts cascade into checkout outage
Checkout success rate dropped from 99.5% to 22%, p99 latency 28s (hitting 30s timeout), thread pool exhausted
- 44%
[Eval][v2][en] Third-party payment gateway timeouts cascade into checkout outage
Checkout success rate dropped from 99.5% to 22%, p99 latency 28s (hitting 30s timeout), thread pool exhausted
- 22%
[Eval][v1][en] Payment service connection pool exhaustion after batch job deploy
p99 latency 4.8s (up from 120ms), 12% 500 error rate, customers report failed checkouts