AlexStocks commented on code in PR #3592:
URL: https://github.com/apache/dubbo-go/pull/3592#discussion_r3718097818


##########
remoting/getty/getty_client.go:
##########
@@ -235,6 +235,9 @@ func (c *Client) Request(request *remoting.Request, timeout 
time.Duration, respo
 
        select {
        case <-gxtime.After(timeout):
+               
remoting.RemovePendingResponse(remoting.SequenceType(request.ID))
+               rpcClient.removeSession(session)

Review Comment:
   [P1] 在超时重置前修复 selectSession 的检查/加锁窗口
   
   这里删除最后一个 session 后会进入 `resetRpcConn`,在 `gettyClientMux` 下把 `gettyClient` 置 
nil、再把 `gettyClientCreated` 置 false;并发 `selectSession` 却先在锁外读 
`gettyClientCreated == true`,随后才取 RLock,因而可以在 reset 完成后继续执行 
`c.gettyClient.selectSession()` 并空指针。确定性交错探针在当前 Head 上 10/10 panic。Base 的 
OnClose 也可能触发 reset,但本行把触发面扩大到每次普通读超时,所以这是本 PR 显著扩大的运行时崩溃路径。请让 created/pointer 
的判断和使用处在同一个 `gettyClientMux` 临界区内(加锁后重新检查 nil/状态),并补 `timeout 
removeSession/reset` 与并发 `selectSession` 的回归测试。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to