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: fix crashable DaemonStateIndex::get calls #17933

Merged
merged 1 commit into from Sep 26, 2017
Merged

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Sep 23, 2017

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

@@ -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,
Copy link
Contributor

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?

@@ -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;
Copy link
Contributor

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.

Copy link
Contributor

@tchaikov tchaikov left a 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>
@jcsp
Copy link
Contributor Author

jcsp commented Sep 25, 2017

Updated to sort out the svc_name/svc_type

@liewegas liewegas merged commit 0313727 into ceph:master Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants