aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2023-08-17 11:40:46 +0200
committerHåkon Hallingstad <hakon@yahooinc.com>2023-08-17 11:40:46 +0200
commitb41905739bf9c7b4e35eb4a9cb85d9d3e6ea8f3a (patch)
tree9e223171dba51c41e00254dce080bb06c2802c27
parent04be36fa3805a5e48715e9b09952506c4e7be751 (diff)
Only run important node maintainers if container is running
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java7
1 files changed, 4 insertions, 3 deletions
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 284306e1e8c..466ee65fcc1 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
@@ -486,7 +486,8 @@ public class NodeAgentImpl implements NodeAgent {
// Run this here and now, even though we may immediately remove the container below.
// This ensures these maintainers are run even if something fails or returns early.
// These maintainers should also run immediately after starting the container (see below).
- container.ifPresent(c -> runImportantContainerMaintainers(context, c));
+ container.filter(c -> c.state().isRunning())
+ .ifPresent(c -> runImportantContainerMaintainers(context, c));
switch (node.state()) {
case ready, reserved, failed, inactive, parked -> {
@@ -561,9 +562,9 @@ public class NodeAgentImpl implements NodeAgent {
}
}
- private void runImportantContainerMaintainers(NodeAgentContext context, Container container) {
+ private void runImportantContainerMaintainers(NodeAgentContext context, Container runningContainer) {
aclMaintainer.ifPresent(maintainer -> maintainer.converge(context));
- wireguardTasks.forEach(task -> task.converge(context, container.id()));
+ wireguardTasks.forEach(task -> task.converge(context, runningContainer.id()));
}
private static void logChangesToNodeSpec(NodeAgentContext context, NodeSpec lastNode, NodeSpec node) {