commit | 9514836c8bfdd0526f132fd18f0b0e4e61c67bdb | [log] [tgz] |
---|---|---|
author | Thomas Vachuska <tom@onlab.us> | Wed Jul 13 14:23:27 2016 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Wed Jul 13 21:52:18 2016 +0000 |
tree | 39a691951f4c114bad8537c8dd2fe1b2aa4ad37c | |
parent | 0583387a45f8a12d1dd467deca3c6ce5e1451924 [diff] |
Fixed an NPE due to a race condition while processing pending network configurations on multiple nodes concurrently. Change-Id: I4a37adc8d059f63115517dbe628233d1fd295d02
diff --git a/core/store/dist/src/main/java/org/onosproject/store/config/impl/DistributedNetworkConfigStore.java b/core/store/dist/src/main/java/org/onosproject/store/config/impl/DistributedNetworkConfigStore.java index 64beb93..315d570 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/config/impl/DistributedNetworkConfigStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/config/impl/DistributedNetworkConfigStore.java
@@ -132,8 +132,12 @@ 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()); + } } }); }