From 6d0498987ae968e5eb4f8a03269a7688b80744a3 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 6 Jan 2018 10:09:22 -0800 Subject: [PATCH] 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. --- src/channel/channel.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/channel/channel.js b/src/channel/channel.js index 096f8866..8b9b2a75 100644 --- a/src/channel/channel.js +++ b/src/channel/channel.js @@ -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); };