chenBright commented on issue #2305:
URL: https://github.com/apache/brpc/issues/2305#issuecomment-1627972832

   
https://github.com/apache/brpc/blob/e4abb3fab3bacbbf127dcda553ddc6b67a2a0888/src/brpc/socket.cpp#L676-L682
   `Create()`的时候,Socket持有了一个引用计数(`additional ref`)。
   
   
https://github.com/apache/brpc/blob/e4abb3fab3bacbbf127dcda553ddc6b67a2a0888/src/brpc/socket.cpp#L995-L997
   `SetFailed`的时候,Socket会减去`additional ref`。
   
   所以`Revive()`的时候,引用计数需要+1,表示持有`additional ref`。
   
   
https://github.com/apache/brpc/blob/e4abb3fab3bacbbf127dcda553ddc6b67a2a0888/src/brpc/details/health_check.cpp#L161-L162
   而健康检查持有的引用计数,会在健康检查结束的时候释放。


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to