Skip to content

Make naming service from sync to async#319

Closed
zyearn wants to merge 3 commits into
apache:masterfrom
zyearn:master
Closed

Make naming service from sync to async#319
zyearn wants to merge 3 commits into
apache:masterfrom
zyearn:master

Conversation

@zyearn
Copy link
Copy Markdown
Member

@zyearn zyearn commented May 9, 2018

No description provided.

servers.clear();
actions->ResetServers(servers);
}
if (bthread_usleep(std::max(FLAGS_consul_retry_interval_ms, 1) * butil::Time::kMillisecondsPerSecond) < 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个consul配置就失效了。


void PeriodicNamingService::Destroy() {
if (_task) {
_task->CleanUp();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这是错的,_actions可能正在被用。

ASSERT_EQ(0, server.Start("localhost:8500", NULL));

bthread_usleep(1000000);
bthread_usleep(5000000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

为什么要sleep这么久?

@jamesge jamesge mentioned this pull request Jul 4, 2018
@stale
Copy link
Copy Markdown

stale Bot commented Jul 23, 2018

This issue has been automatically marked as stale because it's inactive for a long time. It will be closed if no further activity occurs, reopen if you have further ideas. Thank you for your contributions! 由于很久没有活跃,此Issue已被自动标记为过期。之后几天仍无变化的话将会被关闭,若你有新想法则可重新打开。感谢你的贡献!

@stale stale Bot added the wontfix Not belonging to other labels label Jul 23, 2018
@stale stale Bot closed this Jul 30, 2018
@zyearn zyearn reopened this Jul 30, 2018
@stale stale Bot removed the wontfix Not belonging to other labels label Jul 30, 2018
Comment thread src/brpc/naming_service.h
// periodically or by event-driven, call methods of `actions' to tell
// RPC system about server changes.
// `actions' is owned and deleted by this naming service.
virtual void RunNamingService(const char* service_name,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

看本次的修改内容,主要是把所有RunNamingService的实现都从sync改为了async方式。怎么确保今后的其他实现也是async的呢?

@jamesge jamesge closed this Sep 10, 2018
@jamesge
Copy link
Copy Markdown
Contributor

jamesge commented Sep 10, 2018

其中未提交的改动会拆分为更多的pr

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.

3 participants