diff --git a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js index 454d7eab4..cca28fde1 100644 --- a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js +++ b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js @@ -783,8 +783,12 @@ module.exports = function(RED) { if(!client) { resolve(); } else { - const t = setTimeout(reject, ms); - client.end(() => { + const t = setTimeout(() => { + //clean end() has exceeded WAIT_END, lets force end! + client && client.end(true); + reject(); + }, ms); + client.end(() => { clearTimeout(t); resolve() });