From: Noah Watkins Date: Sun, 15 Jul 2018 20:02:58 +0000 (-0700) Subject: mgr: ignore modules that fail to instantiate X-Git-Tag: v14.0.1~748^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a8b5d8425cc8dd2923705dbc94974ecfa8dac31;p=ceph.git mgr: ignore modules that fail to instantiate If an uncaught runtime exception occurs in a module constructor, then the manager still tries to deliver notifications resulting in errors like: src/mgr/ActivePyModule.cc: 54: FAILED assert(pClassInstance != nullptr) This removes the failed module from the set of active modules that should receive command and notifications. This also serves as a basis for accurately determining if the manager satisifes all "always on" module constraints. Signed-off-by: Noah Watkins --- diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 46a0f0a6c75..8ffa7fe2ea6 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -386,6 +386,9 @@ int ActivePyModules::start_one(PyModuleRef py_module) int r = active_module->load(this); if (r != 0) { + // the class instance wasn't created... remove it from the set of activated + // modules so commands and notifications aren't delivered. + modules.erase(py_module->get_name()); return r; } else { dout(4) << "Starting thread for " << py_module->get_name() << dendl;