Re-introduce the resetting of component subscriber after bootstrap
Otherwise, components from a changed bundle with unchanged configs
would get the class of the previous config generation.
@@ -8,6 +8,7 @@ import com.yahoo.container.di.config.Subscriber;
import com.yahoo.container.di.config.SubscriberFactory;
import com.yahoo.vespa.config.ConfigKey;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
@@ -52,7 +53,9 @@ public final class ConfigRetriever {
while (true) {
Optional<ConfigSnapshot> maybeSnapshot = getConfigsOnce(componentConfigKeys, leastGeneration, isInitializing);
if (maybeSnapshot.isPresent()) {
- return maybeSnapshot.get();
+ var configSnapshot = maybeSnapshot.get();
+ resetComponentSubscriberIfBootstrap(configSnapshot);
+ return configSnapshot;
}
}
}
@@ -122,6 +125,12 @@ public final class ConfigRetriever {
}
}
+ private void resetComponentSubscriberIfBootstrap(ConfigSnapshot configSnapshot) {
+ if (configSnapshot instanceof BootstrapConfigs) {
+ setupComponentSubscriber(Collections.emptySet());
+ }
+ }
+
private void setupComponentSubscriber(Set<ConfigKey<? extends ConfigInstance>> keys) {
if (! componentSubscriberKeys.equals(keys)) {
componentSubscriber.close();
