Skip to content

feat(relay): 移植可选 HTTP/2 健康检查 (#169) - #177

Merged
woncc merged 1 commit into
mainfrom
cursor/upstream-issue-169-45746eee4-20261105
Nov 5, 2026
Merged

woncc merged 1 commit into
mainfrom
cursor/upstream-issue-169-45746eee4-20261105

Conversation

@woncc

@woncc woncc commented Nov 5, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

本 PR 由 Codex AI 辅助移植与验证;提交者负责交付内容,待独立审阅。git 身份 woncc 与本 fork 历史主要作者一致。

🔗 关联任务 / Related Issue

Closes #169

上游:45746eee4de25ab1eb75d4b7fbb8de2199483ea3(QuantumNous#8059)。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

📝 变更描述 / Description

移植上游可选 HTTP/2 PING 健康检查。默认关闭;启用后,仅关闭未回应 PING 的连接,健康慢响应继续等待。配置经共享 transport 工厂用于直连、代理和分片,不改变下游 SSE 心跳。

仅变更授权的 5 个文件,补丁 ID 与上游一致,未改依赖或数据库行为。

📸 运行证明 / Proof of Work

实际 Go 版本:go1.27.2 linux/amd64。

GOMAXPROCS=2 RAYON_NUM_THREADS=2 GOWORK=off go test -p=2 ./common/ ./service/ -count=1 -run '^(TestShardedRoundTripperPerOriginRotation|TestOriginKeyUsesSchemeAndHost|TestAutoOneShardNegotiatesHTTP2SingleConnection|TestFourShardHTTP2ReusesExactlyFourConnections|TestForcedHTTP1AgainstHTTP2Server|TestForcedHTTP1ConcurrentDistinctConnections|TestHTTPClientCachePolicyAndCompatibility|TestChannelTLSInsecureSkipVerifyAcceptsUntrustedUpstream|TestHTTPClientCacheConcurrentGetOrCreate|TestShardedRoundTripperCloseIdleConnectionsFansOut|TestInvalidateProxyClientClosesAllPolicyVariants|TestResetProxyClientCacheKeepsDefaultPointerAndRecreatesVariants|TestResetProxyClientCacheClosesDefaultIdlePool|TestResetProxyClientCacheConcurrentWithGetHttpClient|TestCloseIdleConnectionsRedialsHTTP2|TestNormalizeHTTPTransportPolicyClampsWithoutPanic|TestRelayHTTP2HealthCheck)$' -v
GOMAXPROCS=2 RAYON_NUM_THREADS=2 GOWORK=off go test -p=2 ./common/ -count=1
git diff --cached --check
gofmt -l common/constants.go common/init.go service/http_client.go service/http_client_transport_test.go

结果:service 17 个顶层 transport 测试通过(8.088s),覆盖默认禁用、健康慢响应、失联连接关闭与下一请求重连,以及分片、HTTP/1、代理缓存行为。第一条命令的 common 无匹配测试,第二条 common 全包通过(0.451s)。空白与格式检查无输出。

限度:未运行全仓测试、数据库矩阵或部署;未涉及 relaykit/tokenkit 修改。独立审核尚待进行。

✅ 提交前检查项 / Checklist

  • 人工确认: 等待独立人工审阅;不代替人工作出确认。
  • 非重复提交: fork 同分支 PR 查询为空;本 PR 是已授权上游移植。
  • 新功能关联 Issue: 已关联 [上游/现在能解] 45746eee4 feat(relay): add opt-in HTTP/2 health checks (#8059) #169。
  • 事前沟通: 按 owner 明确授权移植指定提交。
  • 功能范围: 聚焦 HTTP/2 健康检查。
  • 非透传: 不修改透传协议行为。
  • 范围聚焦: 仅指定上游提交及 5 个授权文件。
  • 本地验证: 命令与观察结果见上。
  • 安全合规: 未包含凭据;.env.example 仅新增配置注释示例。

@woncc
woncc merged commit 188c862 into main Nov 5, 2026
@woncc
woncc deleted the cursor/upstream-issue-169-45746eee4-20261105 branch December 2, 2026 15:32
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.

[上游/现在能解] 45746eee4 feat(relay): add opt-in HTTP/2 health checks (#8059)

1 participant