fix(notify): 根治低带宽控制面阻塞与传输写入卡死

- 为控制消息增加优先级、公平调度、队列字节预算和自适应批处理
- 支持可取消的写门等待,收紧 shared/dedicated bulk、stream 和 Reply 写入边界
- 修复 bulk reset/close、连接 handoff 和安全 profile 切换时序
- 保留旧取消与超时错误契约,新增阶段化 TransportSendError
- 增加 ReplyCtx、ReplyObjCtx、写超时配置及黑洞连接和竞态回归测试
This commit is contained in:
2026-08-14 10:16:37 +08:00
parent 98ef9e7fcc
commit 0826e17063
45 changed files with 4231 additions and 293 deletions
+7 -3
View File
@@ -50,6 +50,10 @@ func prepareClientSessionRuntime(rt *clientSessionRuntime) *clientSessionRuntime
}
func (c *ClientCommon) setClientSessionRuntime(rt *clientSessionRuntime) {
c.setClientSessionRuntimeWithCloseOld(rt, false)
}
func (c *ClientCommon) setClientSessionRuntimeWithCloseOld(rt *clientSessionRuntime, closeOld bool) {
if c == nil || rt == nil {
return
}
@@ -69,7 +73,7 @@ func (c *ClientCommon) setClientSessionRuntime(rt *clientSessionRuntime) {
c.conn = rt.conn
}
if oldBinding != nil {
oldBinding.stopBackgroundWorkers()
stopReplacedTransportBinding(oldBinding, rt.transport, closeOld)
}
}
@@ -155,7 +159,7 @@ func (c *ClientCommon) clearClientSessionRuntimeTransport() {
next.conn = nil
next.transportStopCtx = nil
next.transportStopFn = nil
c.setClientSessionRuntime(&next)
c.setClientSessionRuntimeWithCloseOld(&next, true)
}
func (c *ClientCommon) clearClientSessionRuntimeQueue() {
@@ -199,7 +203,7 @@ func (c *ClientCommon) attachClientSessionTransport(conn net.Conn) error {
next.transportStopCtx = nil
next.transportStopFn = nil
next.suppressGoodByeOnStop = &atomic.Bool{}
c.setClientSessionRuntime(&next)
c.setClientSessionRuntimeWithCloseOld(&next, true)
if oldConn := oldBinding.connSnapshot(); oldConn != nil && oldConn != conn {
_ = oldConn.Close()
}