chen08209 说明 Concord 将在失效的 Hysteria2 会话上重试一次
chen08209 表示,提交 ce23f213 在缓存的 Hysteria2 QUIC 连接已关闭且 open_bi() 失败时,只按指针身份清除该会话,并在调用者剩余拨号期限内重试一次,避免误删并发建立的替代会话。再次失败或期限已耗尽时保留底层错误;若只是在存活会话等待流额度时超时,则返回 TimedOut,不清除会话。他说明这有意区别于 sing-quic 的直接返回错误行为,并已添加相应确定性测试,改动将纳入下一次发行。
作者原文@chen08209Fixed in ce23f213 (will be included in the next release).
When
open_bi()fails on a closed Hysteria2 QUIC connection, Concord now forgets only that specific cached session by pointer identity (so a concurrently established replacement session is not evicted) and retries once within the caller's remaining dial deadline. If the retry fails—or if the dial deadline is already spent when the firstopen_bi()fails—the underlyingopen_bi()error is preserved without starting another dial; if the dial deadline expires while waiting for stream credit on a still-live session, it returnsTimedOutwithout evicting the session.Note on the reference comparison: both
metacubex/sing-quic(hysteria2/client.go:581-594) andsagernet/sing-quic(hysteria2/client.go:627-643) returnOpenStream()errors directly without retrying, whereas mihomo's Hysteria v1 client (transport/hysteria/core/client.go:155-185) reconnects and retries once on permanent errors. Because quinn'sopen_bi()only fails once the connection has terminated and before any request bytes are written, retrying once recovers transparently with no duplicate application request. We shared the helper between Hysteria v1 and Hysteria2, documented the deliberate difference in.agents/reference-choices.mdanddocs/compatibility.md, and added deterministic unit tests covering stale-session recovery, concurrent replacement, double failure, and dial deadlines.