Thomas Vachuska
Committed by Gerrit Code Review

Fixed an NPE due to a race condition while processing pending network configurat…

…ions on multiple nodes concurrently.

Change-Id: I4a37adc8d059f63115517dbe628233d1fd295d02
......@@ -132,8 +132,12 @@ public class DistributedNetworkConfigStore
ImmutableSet.copyOf(configs.keySet()).forEach(k -> {
if (Objects.equals(k.configKey, configFactory.configKey()) &&
isAssignableFrom(configFactory, k)) {
validateConfig(k, configFactory, configs.get(k).value());
configs.remove(k); // Prune whether valid or not
// Prune whether valid or not
Versioned<JsonNode> versioned = configs.remove(k);
// Allow for the value to be processed by another node already
if (versioned != null) {
validateConfig(k, configFactory, versioned.value());
}
}
});
}
......