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

mgr,mon: debug init and mgrdigest subscriptions #16351

Merged
merged 2 commits into from Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/mgr/Mgr.cc
Expand Up @@ -222,12 +222,13 @@ void Mgr::init()
load_config();

// Wait for MgrDigest...
while(!digest_received) {
dout(4) << "waiting for MgrDigest..." << dendl;
while (!digest_received) {
digest_cond.Wait(lock);
}

// assume finisher already initialized in background_init

dout(4) << "starting PyModules..." << dendl;
py_modules.init();
py_modules.start();

Expand Down
6 changes: 5 additions & 1 deletion src/mon/MgrMonitor.cc
Expand Up @@ -326,7 +326,8 @@ void MgrMonitor::check_sub(Subscription *sub)
{
if (sub->type == "mgrmap") {
if (sub->next <= map.get_epoch()) {
dout(20) << "Sending map to subscriber " << sub->session->con << dendl;
dout(20) << "Sending map to subscriber " << sub->session->con
<< " " << sub->session->con->get_peer_addr() << dendl;
sub->session->con->send_message(new MMgrMap(map));
if (sub->onetime) {
mon->session_map.remove_sub(sub);
Expand All @@ -353,12 +354,15 @@ void MgrMonitor::send_digests()
if (!is_active()) {
return;
}
dout(10) << __func__ << dendl;

const std::string type = "mgrdigest";
if (mon->session_map.subs.count(type) == 0)
return;

for (auto sub : *(mon->session_map.subs[type])) {
dout(10) << __func__ << " sending digest to subscriber " << sub->session->con
<< " " << sub->session->con->get_peer_addr() << dendl;
MMgrDigest *mdigest = new MMgrDigest;

JSONFormatter f;
Expand Down