Skip to content

GitHub API 请求间歇性 502 + SocketException(10054) 远程强制关闭连接(长请求 ~19s 后断连) #4127

Description

@bfxh

现象

使用 Watt Toolkit 加速 GitHub 时,部分 API 请求间歇性 502 + 连接被强制关闭(重试可恢复,非持续故障)。

证据(Windows 事件日志,.NET Runtime,BD.WTTS)

Category: BD.WTTS.Services.Implementation.RequestLoggingMiddleware
RequestPath: /esengine/DeepSeek-Reasonix/commit/<sha>/status-details
GET https://github.com/esengine/DeepSeek-Reasonix/commit/<sha>/status-details
responded 502 in 19270.2373 ms

System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.IO.IOException: Unable to read data from the transport connection: 远程主机强迫关闭了一个现有的连接。
 ---> System.Net.Sockets.SocketException (10054): 远程主机强迫关闭了一个现有的连接。

环境

  • Windows 10/11(x64)
  • Watt Toolkit(Steam++)当前最新版(事件日志仅显示 BD.WTTS 命名空间,未含版本号)
  • 复现路径:GitHub 网页/API 调用(commit status-details 类长请求)在加速开启时偶发

分析

  • SocketException (10054) = 远端(代理出口或被代理的 github.com)强制关闭连接——发生在请求发出后 ~19 秒(长请求场景)
  • 长请求(>10s,如 status-details/checks 聚合)更容易触发;短请求正常
  • 怀疑:代理连接池的 keep-alive/超时与上游断开不一致,或出口 IP 被 GitHub 限流后断连

期望

  • 长请求(>15s)不被强制断连;或断连后自动重试 1-2 次再报 502
  • 日志中带上 Watt Toolkit 自身版本号,便于用户上报

(若需我补充抓包/复现步骤,请告知)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions