From f3aeb2d737af2058d39581c6a375e8efe61a77a7 Mon Sep 17 00:00:00 2001 From: Valerij Fredriksen Date: Wed, 7 Nov 2018 17:13:27 +0100 Subject: Simplify --- .../yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'node-admin/src') diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java index da6656ac830..82802a4c6af 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java @@ -227,7 +227,8 @@ public class NodeAgentImpl implements NodeAgent { final NodeAttributes currentNodeAttributes = new NodeAttributes(); final NodeAttributes newNodeAttributes = new NodeAttributes(); - if (!Objects.equals(node.getCurrentRestartGeneration(), currentRestartGeneration)) { + if (node.getWantedRestartGeneration().isPresent() && + !Objects.equals(node.getCurrentRestartGeneration(), currentRestartGeneration)) { currentNodeAttributes.withRestartGeneration(node.getCurrentRestartGeneration()); newNodeAttributes.withRestartGeneration(currentRestartGeneration); } @@ -469,11 +470,10 @@ public class NodeAgentImpl implements NodeAgent { if (!node.equals(lastNode)) { logChangesToNodeSpec(lastNode, node); - if (currentRebootGeneration < node.getCurrentRebootGeneration()) + if (lastNode == null) { currentRebootGeneration = node.getCurrentRebootGeneration(); - - if (currentRestartGeneration.isPresent() != node.getCurrentRestartGeneration().isPresent()) currentRestartGeneration = node.getCurrentRestartGeneration(); + } // Every time the node spec changes, we should clear the metrics for this container as the dimensions // will change and we will be reporting duplicate metrics. -- cgit v1.2.3