mirror of
https://github.com/ceph/ceph
synced 2025-01-21 02:31:19 +00:00
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 <nwatkins@redhat.com>
This commit is contained in:
parent
a4ec7f5f22
commit
6a8b5d8425
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user