Skip to content

fix(data): 重试财经快讯瞬时连接故障 - #151

Merged
mirror29 merged 1 commit into
mainfrom
fix/cn-market-news-retry
Jul 27, 2026
Merged

fix(data): 重试财经快讯瞬时连接故障#151
mirror29 merged 1 commit into
mainfrom
fix/cn-market-news-retry

Conversation

@mirror29

Copy link
Copy Markdown
Owner

根因

生产机到东财快讯域名的 TLS 建连间歇超时。CnMarketConnector._get_json() 对第一次 httpx.TransportError 零重试,直接转换为 502。生产连续 5 次探测中 1 次成功、4 次握手超时;固定两个 DNS 地址后均能返回 200,说明是瞬时网络路径抖动,不是接口改版。

修复

  • 幂等市场数据 GET 对 httpx.TransportError 受控重试一次
  • 第二次仍失败时保留 502,并在错误中加入异常类型
  • 增加首轮 ConnectTimeout、次轮成功的回归测试

验证

  • ruff check 通过
  • services/data/tests/test_market.py: 17 passed
  • data 非集成测试:153 passed,2 个与本修复无关的日期硬编码测试失败(预期 2026-07-23,当前日期为 2026-07-27)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review base: 88021d8

🤖 GLM-5.2 PR Review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying inalpha-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 92c9ece
Status: ✅  Deploy successful!
Preview URL: https://aafb1ab3.inalpha-web.pages.dev
Branch Preview URL: https://fix-cn-market-news-retry.inalpha-web.pages.dev

View logs

@mirror29
mirror29 force-pushed the fix/cn-market-news-retry branch from c4f56a7 to a382689 Compare July 27, 2026 03:34
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mirror29
mirror29 force-pushed the fix/cn-market-news-retry branch from a382689 to 92c9ece Compare July 27, 2026 03:43
@mirror29
mirror29 merged commit e21bd70 into main Jul 27, 2026
10 checks passed
@mirror29
mirror29 deleted the fix/cn-market-news-retry branch July 27, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant