Skip to content

Releases

修复 GitHub Actions 断连失败与 Node 20 弃用警告

Choose a tag to compare

@jasper0507 jasper0507 released this 25 Aug 22:10

现象

GitHub Actions 近期几乎每次都带 Annotations:1 error and 1 warning(成功的运行只有 warning)。

  • Warning:Node.js 20 is deprecated(actions/checkout@v4、actions/setup-python@v5)
  • Error:Process completed with exit code 1 或 exit code 2,出现在 Run check-in

原因

两件独立的事,叠在同一条 Annotation 栏里。

1. Error:对端掐连接,客户端没当成网络错误

hyperdown.net 对 GitHub Actions 出口会偶发直接断开,日志为:

http.client.RemoteDisconnected: Remote end closed connection without response

登录阶段被收成「鉴权异常」→ exit 2;签到阶段未捕获 → exit 1。

根因:HyperdownClient.request() 只把 urllib.error.URLError 映射成 network_error。RemoteDisconnected 属于 http.client.HTTPException,漏出去了。协议、账号、封包都没问题——隔天同一套代码可以签成功。

2. Warning:官方 Action 仍声明 Node 20

Runner 已强制用 Node 24 跑这些 action,于是每次都挂弃用警告。不影响签到结果。

修复

提交 99a3445

项 做法
网络 断连 / 超时 / URLError → network_error;request() 最多 3 次、指数退避(0.5s / 1s)
封包 每次重试重新 SealJSON,时间戳保持新鲜
业务错误 ok: false 不重试
退出码 重试耗尽 → exit 4(不再是 1 / 2)
Actions checkout@v5、setup-python@v6(Node 24);keepalive.yml 同步

验证

  • 本地:python3 -m unittest tests.test_client_network -v(5 项)
  • 线上:Check-in #28(workflow_dispatch)成功,Annotations 为空,签到 +1 GB

对端再掐连接时,日志会出现 网络中断,重试 1/3: ...;三次都失败才会红,且为 exit 4。