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 <nwatkins@redhat.com>
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;