summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-11-25 13:07:18 +0100
committerjonmv <venstad@gmail.com>2022-11-25 13:07:18 +0100
commit749ecea6161ff3bb694058609ee17d615d3fd02b (patch)
tree12fe77e30db9206c71b813d2d63abfa35fbd9ebe /controller-server
parent158799d86aa40536afad719864a296883249982a (diff)
Take ns queue lock
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
index 4e2eb03f01d..d721528f13b 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java
@@ -383,10 +383,12 @@ public class RoutingPolicies {
nameServiceForwarderIn(allocation.deployment.zoneId()).createTxt(challenge.name(), List.of(challenge.data()), Priority.high);
Instant doom = controller.clock().instant().plusSeconds(30);
while (controller.clock().instant().isBefore(doom)) {
- if (controller.curator().readNameServiceQueue().requests().stream()
- .noneMatch(request -> request.name().equals(Optional.of(challenge.name())))) {
- challenge.trigger().run();
- return;
+ try (Mutex lock = controller.curator().lockNameServiceQueue()) {
+ if (controller.curator().readNameServiceQueue().requests().stream()
+ .noneMatch(request -> request.name().equals(Optional.of(challenge.name())))) {
+ challenge.trigger().run();
+ return;
+ }
}
Thread.sleep(100);
}