Skip to content

Conversation

@wwbmmm
Copy link
Contributor

@wwbmmm wwbmmm commented Jun 10, 2022

Fix #1772

}

int Socket::SetFailedOnCreate(int error_code, const char* error_text) {
_user = NULL; // Avoid calling _user->BeforeRecycle() which may cause dead lock or double free
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是可以反过来在BeforeRecycle前判一下rpc failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里主要是为了区分是在Create Socket过程中出错,还是使用Socket过程中出错
回调BeforeRecycle的时候,Socket已经是Failed的状态了,似乎难以区分是不是Create Socket的过程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

brpc::Acceptor::StartAccept和brpc::Acceptor::BeforeRecycle之间构成死锁

2 participants