Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: consul ns thread can not quit #586

Merged
merged 3 commits into from
Dec 3, 2018

Conversation

cdjingit
Copy link
Contributor

No description provided.

@@ -234,6 +234,10 @@ int ConsulNamingService::RunNamingService(const char* service_name,
return -1;
}
}
if (errno == EINTR) {
Copy link
Contributor

Choose a reason for hiding this comment

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

为什么把errno的判定放这里?只要前面的函数不设errno,或没有返回-1,errno都没有意义

@@ -234,6 +234,10 @@ int ConsulNamingService::RunNamingService(const char* service_name,
return -1;
}
}
if (bthread_stopped(bthread_self())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个不应该加到rc == 0的分支中去么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rc != 0的情况下,也有可能被stop了,bthread_usleep会成功不会退出,因为meta->interrupted已经false了

@jamesge jamesge added the bug the code does not work as expected label Dec 3, 2018
@jamesge jamesge merged commit dde83f0 into apache:master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the code does not work as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants