fausturs commented on issue #2315:
URL: https://github.com/apache/brpc/issues/2315#issuecomment-1633928238

   补充一下,我跑的测试代码
   
   <img width="971" alt="image" 
src="https://github.com/apache/brpc/assets/25004087/843e0d60-5ce3-4fcb-b960-7dea067da82c";>
   
   brpc部分,就是随便加点输出信息。
   
   <img width="768" alt="image" 
src="https://github.com/apache/brpc/assets/25004087/690835c3-45b1-4de9-b419-09e3cb989f91";>
   搞一个server,类似这样,在处理request得时候提交两个子任务。
   
   <img width="1030" alt="image" 
src="https://github.com/apache/brpc/assets/25004087/b4ef9aeb-2693-4a35-afd7-2f69c23259c7";>
   一个可能的输出是这样的。
   
可以看到,在时间轴上,两个线程分别设置了span->_next_client之后,再分别设置了parent->_next_client。这个时候容易知道链表中只有一个节点了(预期是两个)。此时内存泄漏了。
   
![image](https://github.com/apache/brpc/assets/25004087/dc90a118-dd5f-4942-8e9f-ba2506a4ec07)
   con从rpcz页面中也能看到,client span只有一个了。
   
   
   如果同时写parent->_next_client,则可能写坏内存,导致出core。这个就比较难复现了。
   
   
   
   
   
   
   


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