You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/06/14 15:26:17 UTC

[GitHub] [incubator-brpc] jamesge commented on a diff in pull request #1791: Fix Acceptor::BeforeRecycle during Accept::StartAccept dead lock

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


##########
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:
   这个是不是可以反过来在BeforeRecycle前判一下rpc failed?



-- 
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-unsubscribe@brpc.apache.org

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


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