wwbmmm commented on issue #1772: URL: https://github.com/apache/incubator-brpc/issues/1772#issuecomment-1153490714
目前继承SocketUser的有几个地方: * Socket::EpollOutRequest: 如果[在Create过程中回调BeforeRecycle,会delete req](https://github.com/apache/incubator-brpc/blob/master/src/brpc/socket.cpp#L403);[Create失败之后,也会delete req](https://github.com/apache/incubator-brpc/blob/master/src/brpc/socket.cpp#L1156),从而造成double free * SelectiveChannel的SubChannel:如果[在Create过程中回调BeforeRecycle,会delete SubChannel](https://github.com/apache/incubator-brpc/blob/master/src/brpc/selective_channel.cpp#L46);[Create失败之后,也会delete SubChannel](https://github.com/apache/incubator-brpc/blob/master/src/brpc/selective_channel.cpp#L194),从而造成double free * InputMessenger: 没有实现自己的BeforeRecycle方法,因此是否回调无影响 * Acceptor: 继承了InputMessenger并重写了BeforeRecycle方法,这个就是当前的case,如果Create过程回调BeforeRecycle会导致死锁 而该PR的逻辑就是让Create过程不回调BeforeRecycle,综上所述,该PR修复了2处潜在的double free和1处死锁,除此之外应该没有其它影响 -- 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]
