From 177278fee3c0976840f885d1dabf1a4ad166b1c5 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 21 May 2021 17:27:25 +0200 Subject: [PATCH] Ignore instance status changes that didn't change Check if the instance status in the instanceStatusChanged event actually changed and ignore the event if it didn't. This prevents bogus updates from being pushed to control clients and plugins. --- packages/master/src/SlaveConnection.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/master/src/SlaveConnection.js b/packages/master/src/SlaveConnection.js index 19829d0f..3243cd11 100644 --- a/packages/master/src/SlaveConnection.js +++ b/packages/master/src/SlaveConnection.js @@ -62,6 +62,15 @@ class SlaveConnection extends BaseConnection { return; } + // We may receive status changed where the status hasn't changed + // from our perspective if the connection was down at the time it + // changed. Slaves also send status updates on assignInstance which + // for hacky reason is also used to push config changes and + // restablish status after a connection loss. + if (instance.status === message.data.status) { + return; + } + let prev = instance.status; instance.status = message.data.status; logger.verbose(`Instance ${instance.config.get("instance.name")} State: ${instance.status}`);