← All incidents

[Eval][v2][zh] Third-party payment gateway timeouts cascade into checkout outage

service: checkout-svccreated: 6/2/2026, 11:58:03 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

SEV1

checkout-svc 的结账成功率从 99.5% 骤降至 22%,p99 延迟达到 28 秒(接近 30 秒超时),线程池耗尽。根本原因是下游 Stripe Connect API 在 us-east-1 区域出现延迟飙升,且服务未配置熔断或隔离机制,导致所有工作线程被阻塞。

Severity reasoning: 用户面结账失败率达 78%,超过 1% 阈值且持续超过 5 分钟;收入链路(GMV)受损,预计损失 $180k;符合 SEV1 定义。

deepseek-chat·prompt v2·output: zh·13115ms·2162↑ / 2052↓ tok·$0.00284

Root cause hypotheses

  • highStripe Connect API 在 us-east-1 区域出现延迟飙升,导致 checkout-svc 的 HTTP 调用超时,线程池耗尽。

    Evidence: APM 显示 Stripe /v1/payment_intents 的 p99 延迟从 800ms 升至 27s;Stripe 状态页面确认 us-east-1 区域延迟问题。

  • highcheckout-svc 的 Stripe 客户端未配置熔断器,导致所有请求持续等待超时,线程无法释放。

    Evidence: 配置中无 circuit breaker;线程池利用率 100%,队列深度 4200。

  • highStripe 调用与主工作线程共享线程池,无 bulkhead 隔离,导致单一下游问题影响整个服务。

    Evidence: 配置中无 bulkhead;所有线程被 Stripe 调用阻塞。

  • mediumcheckout-svc 的 Stripe 超时设置(30s)与网关超时一致,导致请求在超时前无法快速失败。

    Evidence: Stripe 调用超时 30s,与 inbound 网关超时相同;p99 28s 接近超时。

  • lowStripe 客户端连接池耗尽或 DNS 解析问题。

    Evidence: 无直接证据;但 APM 显示延迟而非连接错误,可能性较低。

Investigation checklist

  1. 确认 Stripe 延迟是否仍在持续
    curl -s -o /dev/null -w '%{http_code} %{time_total}' https://api.stripe.com/v1/payment_intents -H 'Authorization: Bearer <token>'

    Expected: 返回 200 且 time_total < 1s 表示恢复;否则延迟仍高。

  2. 检查 checkout-svc 线程池和队列深度
    kubectl exec -n prod deploy/checkout-svc -- curl -s localhost:8080/actuator/threadpool | jq '.threadPoolUtilization, .queueDepth'

    Expected: utilization < 100% 且 queueDepth 下降表示缓解。

  3. 查看 Stripe 调用超时分布
    kubectl logs -n prod -l app=checkout-svc --since=10m | grep -E 'stripe.*timeout|payment_intents.*duration' | awk '{print $NF}' | sort -n | tail -20

    Expected: 大部分 duration 接近 30s 表示超时;若 <1s 则问题可能已恢复。

  4. 检查 Stripe 客户端连接池状态
    kubectl exec -n prod deploy/checkout-svc -- curl -s localhost:8080/actuator/metrics/http.client.requests | jq '.measurements[0].value'

    Expected: active 连接数应小于 max;若等于 max 则连接池耗尽。

  5. 确认其他下游服务是否正常
    kubectl logs -n prod -l app=checkout-svc --since=10m | grep -E 'auth-svc|fraud-svc' | awk '{print $NF}' | sort | uniq -c

    Expected: auth-svc 和 fraud-svc 的延迟应正常(<100ms)。

Mitigation plan

  • 启用 Stripe 客户端的熔断器(circuit breaker),设置失败阈值(例如 50% 请求失败时熔断 30 秒),快速失败避免线程耗尽。

    Risk: 熔断期间所有 Stripe 支付将失败,导致结账完全不可用;但可避免线程池耗尽,且 Stripe 本身已故障。

    Rollback: 回滚配置,移除熔断器设置,恢复为直接调用。

  • 为 Stripe 调用添加独立线程池(bulkhead),限制最大并发数(例如 10),保护主线程池。

    Risk: 配置错误可能导致 Stripe 调用被限流,影响吞吐;需确保 bulkhead 大小合理。

    Rollback: 回滚 bulkhead 配置,恢复共享线程池。

  • 降低 Stripe 调用超时时间(例如从 30s 降至 5s),配合重试机制,避免长时间阻塞。

    Risk: 超时过短可能导致正常请求失败;需配合重试和退避策略。

    Rollback: 恢复超时时间为 30s。

Customer impact

约 78% 的结账尝试失败,影响约 3000 笔订单,预计损失 $180k 的 GMV。用户看到 HTTP 504 错误或结账页面超时。当前无 ETA,取决于 Stripe 恢复情况。

Postmortem draft

Summary

[FILL IN]

Timeline (UTC)

  • 18:35 - Stripe 状态页面报告 us-east-1 区域 Connect API 延迟升高
  • 18:40 - checkout-svc 成功率开始下降,p99 延迟飙升
  • 18:38 - 值班工程师收到告警
  • 18:41 - 确认 Stripe 为根因
  • 18:43 - 讨论缓解方案
  • [FILL IN] - 缓解措施实施时间
  • [FILL IN] - 服务恢复时间

Impact

  • 结账成功率从 99.5% 降至 22%
  • p99 延迟 28s
  • 约 3000 笔订单失败,GMV 损失 $180k

Root Cause

Stripe Connect API 在 us-east-1 区域出现延迟飙升,导致 checkout-svc 的 HTTP 调用超时。由于未配置熔断器和 bulkhead,所有工作线程被阻塞,线程池耗尽,新请求排队直至超时。

Detection

  • 监控告警:成功率低于阈值、p99 延迟过高
  • 值班工程师通过 APM 和 Stripe 状态页面确认

Response

  • [FILL IN] 启用熔断器
  • [FILL IN] 添加 bulkhead
  • [FILL IN] 调整超时时间

What Went Well

  • 告警及时
  • 快速定位根因

What Went Poorly

  • 缺乏熔断和隔离机制
  • 超时设置不合理

Action Items

  • [FILL IN] 为所有下游依赖添加熔断器
  • [FILL IN] 实现 bulkhead 隔离
  • [FILL IN] 审查超时配置
  • [FILL IN] 增加 Stripe 状态页面监控集成

Follow-ups

  • P0为 Stripe 客户端添加熔断器,配置失败阈值和半开状态服务所有者
  • P0实现 bulkhead 隔离,为关键下游调用分配独立线程池服务所有者
  • P1审查并调整所有下游调用的超时时间,确保快速失败服务所有者
  • P1集成 Stripe 状态页面到监控系统,自动告警平台团队
  • P1增加线程池耗尽和队列深度的告警可观测性团队
  • P2进行故障演练,测试熔断和 bulkhead 效果SRE 团队