chenBright opened a new pull request, #2123: URL: https://github.com/apache/brpc/pull/2123
### What problem does this PR solve? Issue Number: #584 Problem Summary: 继承自PeriodicNamingService的ns,例如DiscoveryNamingService、NacosNamingService、RemoteFileNamingService,在GetServers中通过rpc拉取节点的时候,NamingServiceThread析构调用bthread_stop并不能中断CallMethod,CallMethod只是被唤醒了一下,而且将interrupted置会为false,CallMethod依然会等到rpc结束。但是这时候bthread_usleep已经不能感知到bthread_interrupt而退出了。 ### What is changed and the side effects? 1. PeriodicNamingService通过判断bthread_stopped来退出。 2. ConsulNamingService本质上是一个PeriodicNamingService,将其抽象为PeriodicNamingService的派生类。 Changed: Side effects: - Performance effects(性能影响): - Breaking backward compatibility(向后兼容性): --- ### Check List: - Please make sure your changes are compilable(请确保你的更改可以通过编译). - When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试). - Please follow [Contributor Covenant Code of Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则). -- 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]
