aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-11-10 21:43:05 +0100
committerGitHub <noreply@github.com>2021-11-10 21:43:05 +0100
commita08fbcaf4b28dc0f33452142545e38836062288b (patch)
tree18b1a387b86b2f1e8368fde112dee7460fef5694 /config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java
parentecbdff405dfa60524c5ae66da4dad81d337587de (diff)
parenta218ec7919bb0a06708c08759bda962dbad01b90 (diff)
Merge pull request #19962 from vespa-engine/revert-19960-revert-19957-hmusum/always-set-new-config-when-updated-generation-take-2v7.499.15
Always set new config when updated generation, take 3
Diffstat (limited to 'config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java
index 27099790f5b..c6ea79ddbcd 100644
--- a/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java
+++ b/config/src/main/java/com/yahoo/config/subscription/impl/JRTConfigSubscription.java
@@ -73,7 +73,7 @@ public class JRTConfigSubscription<T extends ConfigInstance> extends ConfigSubsc
if (jrtReq.hasUpdatedConfig()) {
setNewConfig(jrtReq);
} else {
- setGeneration(jrtReq.getNewGeneration());
+ setNewConfigAndGeneration(jrtReq);
}
}
@@ -110,6 +110,18 @@ public class JRTConfigSubscription<T extends ConfigInstance> extends ConfigSubsc
}
}
+ protected void setNewConfigAndGeneration(JRTClientConfigRequest jrtReq) {
+ try {
+ T configInstance = toConfigInstance(jrtReq);
+ setConfigAndGeneration(jrtReq.getNewGeneration(),
+ jrtReq.responseIsApplyOnRestart(),
+ configInstance,
+ jrtReq.getNewChecksums());
+ } catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("Bad config in response", e);
+ }
+ }
+
/**
* This method should ideally throw new MissingConfig/Configuration exceptions and let the caller
* catch them. However, this would make the code in JRT/File/RawSource uglier.