fix(node,agent): 转发链路两处慢失败补超时——①节点转发握手(告知目标+等agent回执)新增 HandshakeTimeout 默认5s, agent会话半死时观看端不再无限挂起到点即断、握手成功即清除不约束数据阶段; ②agent 拨内网目标新增 DialTimeout 默认5s(Agent 可配), 目标离线且防火墙丢包时不再裸 Dial 吊20s+, 到点回执失败观看端立即断开; 附 e2e 红绿双向证明(半死agent/黑洞拨号 两场景撤修复必红)
This commit is contained in:
+5
-1
@@ -22,7 +22,11 @@ func (a *Agent) handleData(stream net.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
conn, err := net.Dial("tcp", t.TargetAddr())
|
||||
dialTimeout := a.DialTimeout
|
||||
if dialTimeout <= 0 { // 零值 Agent 兜底
|
||||
dialTimeout = defaultDialTimeout
|
||||
}
|
||||
conn, err := net.DialTimeout("tcp", t.TargetAddr(), dialTimeout)
|
||||
if err != nil {
|
||||
a.logger().Warnf("agent 拨号本地目标失败 target=%s err=%s", t.TargetAddr(), err.Error())
|
||||
rf := NewFrame(FrameVersion, CmdTarget, f.StreamID())
|
||||
|
||||
Reference in New Issue
Block a user