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: fix crashable DaemonStateIndex::get calls #17933
Conversation
@@ -121,10 +121,15 @@ PyObject *PyModules::list_servers_python() | |||
|
|||
PyObject *PyModules::get_metadata_python( | |||
std::string const &handle, | |||
const std::string &svc_name, | |||
const std::string &svc_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to update the function declaration accordingly?
src/mgr/PyModules.cc
Outdated
@@ -141,6 +146,11 @@ PyObject *PyModules::get_daemon_status_python( | |||
const std::string &svc_id) | |||
{ | |||
auto metadata = daemon_state.get(DaemonKey(svc_name, svc_id)); | |||
if (metadata == nullptr) { | |||
derr << "Requested missing service " << svc_type << "." << svc_id << dendl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/svc_type/svc_name/ or update the function signature and its declaration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as commented.
This function was recently fixed to return null on missing entries: handle that properly. Fixes: http://tracker.ceph.com/issues/17737 Signed-off-by: John Spray <john.spray@redhat.com>
Updated to sort out the svc_name/svc_type |
This function was recently fixed to return null
on missing entries: handle that properly.
Fixes: http://tracker.ceph.com/issues/17737
Signed-off-by: John Spray john.spray@redhat.com