Add sanity check for one instance of error unload

Unfortunately I think this is just one of a whole class of race
conditions caused by errored channels being unloaded immediately without
waiting for the refcounter to reach 0.

However, this one is the only one that appears commonly in the logs so
adding this check should buy time to rethink the overall problem.
This commit is contained in:
Calvin Montgomery 2018-01-06 10:09:22 -08:00
parent 78bffad888
commit 6d0498987a

View file

@ -317,6 +317,15 @@ Channel.prototype.checkModules = function (fn, args, cb) {
return;
}
if (!self.modules) {
LOGGER.warn(
'checkModules(%s): self.modules is undefined; dead=%s',
fn,
self.dead
);
return;
}
var module = self.modules[m];
module[fn].apply(module, args);
};