wwbmmm commented on code in PR #1791:
URL: https://github.com/apache/incubator-brpc/pull/1791#discussion_r898629340


##########
src/brpc/socket.cpp:
##########
@@ -875,6 +870,12 @@ int Socket::SetFailed() {
     return SetFailed(EFAILEDSOCKET, NULL);
 }
 
+int Socket::SetFailedOnCreate(int error_code, const char* error_text) {
+    _user = NULL; // Avoid calling _user->BeforeRecycle() which may cause dead 
lock or double free

Review Comment:
   这里主要是为了区分是在Create Socket过程中出错,还是使用Socket过程中出错
   回调BeforeRecycle的时候,Socket已经是Failed的状态了,似乎难以区分是不是Create 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