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

fix multi daemon can't start on same node #2289

Merged
merged 2 commits into from
Aug 11, 2020
Merged

Conversation

critical27
Copy link
Contributor

@critical27 critical27 commented Aug 11, 2020

Introduced in #2278, if we want to start multiple daemon with different flag file, the FLAGS_pid_file is the same because we have not init gflags yet. (all of them is the default value of FLAGS_pid_file, not the one in flag file)

So we need to init gflags, glogs by manual instead of folly::init.

@@ -170,7 +171,8 @@ int main(int argc, char *argv[]) {
}

google::SetVersionString(nebula::versionString());
folly::init(&argc, &argv, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove the init method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because folly::init is almost same with init gflags + glog + singleton. You mean we init gflags twice?

@dangleptr
Copy link
Contributor

Introduced in #2278, if we want to start multiple daemon with different flag file, the FLAGS_pid_file is the same because we have not init gflags yet.

So we need to init gflags, glogs by manual instead of folly::init.

I am confused, if you want to start multi instances on one host, each instance should have its own pid file in config file, right?

@critical27
Copy link
Contributor Author

Init gflags twice, one before check pid, the other in folly::init

Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liuyu85cn liuyu85cn left a comment

Choose a reason for hiding this comment

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

LGTM

@dangleptr dangleptr merged commit 1d2a346 into vesoft-inc:master Aug 11, 2020
@critical27 critical27 deleted the fix branch August 12, 2020 05:50
xuguruogu pushed a commit to xuguruogu/nebula that referenced this pull request Sep 12, 2020
* fix multi daemon can't start on same node

* address comments
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* fix multi daemon can't start on same node

* address comments
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants