Skip to content

H3_REQUEST_CANCELLED 误报为 ERROR #3804

@lurixo

Description

@lurixo

Operating system

Linux

System version

ubuntu24.04

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

1.13.0-rc4

Description

客户端 naive outbound,通过 SFA 测试延迟以后,服务端 naive inbound 在 QUIC 模式下,客户端取消 CONNECT 请求时,出现了预期之外的 ERROR 日志:

ERROR connection: connection upload closed: H3_REQUEST_CANCELLED

可能是 sing/common/baderror/baderror.goWrapH2() 函数缺少对 HTTP/3 特有取消错误的匹配。现有模式 "; CANCEL" 匹配的是 HTTP/2 的 stream error: stream ID x; CANCEL 格式,而 quic-go/http3 返回的错误字符串是 H3_REQUEST_CANCELLED(HTTP/3 错误码 0x0108),不包含 "; CANCEL" 子串。

错误未被转换为 net.ErrClosed,导致 route/conn.goIsClosedOrCanceled() 无法识别,走了 ERROR 分支而非 TRACE。

这个报错,只有在naive outbound启用quic时,才会出现。使用默认的HTTP/2,不会出现这个问题

Reproduction

服务端和客户端均使用sing-box,分别配置naive入站和出站,naive出站启用quic,点击SFA延迟测试按钮,可以100%复现。

Logs

Image

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions