lsdh-fei opened a new issue, #3107:
URL: https://github.com/apache/brpc/issues/3107

   **Describe the bug**
   
   Socket::OnCreated 函数中会给 _io_event 手动设置 bthread_tag 
`_io_event.set_bthread_tag(options.bthread_tag);`,但是 _io_event 构造时会使用 
bthread_self_tag(),如果调用 Socket::OnCreated 构造 _io_event 的和 SocketOptions 中的 
bthread_tag 不同,那么 IOEvent::AddConsumer 和 RemoveConsumer 
中GetGlobalEventDispatcher 就会获取到不同的 EventDispatcher。
   
   **To Reproduce**
   
   在 bthread_tag 1 中开启 rpc 服务,然后在其中使用 rdma client 
请求其他服务。其他服务实例重启,后续client就无法正确建联。
   
   RdmaEndpoint::ProcessHandshakeAtClient 建联时,RdmaEndpoint::AllocateResources() 
中 Socket::Create 传入的 SocketOptions 没有指定 bthread_tag  ,那么 
Socket::ResetFileDescriptor 中 _io_event.AddConsumer 时就会使用 bthread_tag 0,如果 
Socket::Create 是 tag 1,后续就会在错误的EventDispatcher中 RemoveConsumer,后续重用 socket 
就会有问题 
   
   应该所有 Socket::OnCreated 调用时,传入的options中没有指定thread_tag都会有风险
   
   **Expected behavior**
   
   使用相同的tag处理socket创建
   
   
   


-- 
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