mgr/Mgr: fix deadlock in load_config

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-06-05 16:15:43 -04:00
parent 390ad9031f
commit 30ae537a55

View File

@ -348,9 +348,10 @@ void Mgr::load_config()
std::ostringstream cmd_json;
cmd_json << "{\"prefix\": \"config-key get\", \"key\": \"" << key << "\"}";
get_cmd.run(monc, cmd_json.str());
lock.Unlock();
get_cmd.wait();
lock.Lock();
assert(get_cmd.r == 0);
loaded[key] = get_cmd.outbl.to_str();
}
}