Yuta HIGUCHI

bugfix: should notify merged description

Change-Id: I3f3658bef36ca9e90f796050abfb641e4cf8540d
...@@ -237,14 +237,20 @@ public class GossipLinkStore ...@@ -237,14 +237,20 @@ public class GossipLinkStore
237 237
238 final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp); 238 final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp);
239 239
240 - LinkEvent event = createOrUpdateLinkInternal(providerId, deltaDesc); 240 + LinkKey key = new LinkKey(linkDescription.src(), linkDescription.dst());
241 + final LinkEvent event;
242 + final Timestamped<LinkDescription> mergedDesc;
243 + synchronized (getLinkDescriptions(key)) {
244 + event = createOrUpdateLinkInternal(providerId, deltaDesc);
245 + mergedDesc = getLinkDescriptions(key).get(providerId);
246 + }
241 247
242 if (event != null) { 248 if (event != null) {
243 log.info("Notifying peers of a link update topology event from providerId: " 249 log.info("Notifying peers of a link update topology event from providerId: "
244 + "{} between src: {} and dst: {}", 250 + "{} between src: {} and dst: {}",
245 providerId, linkDescription.src(), linkDescription.dst()); 251 providerId, linkDescription.src(), linkDescription.dst());
246 try { 252 try {
247 - notifyPeers(new InternalLinkEvent(providerId, deltaDesc)); 253 + notifyPeers(new InternalLinkEvent(providerId, mergedDesc));
248 } catch (IOException e) { 254 } catch (IOException e) {
249 log.info("Failed to notify peers of a link update topology event from providerId: " 255 log.info("Failed to notify peers of a link update topology event from providerId: "
250 + "{} between src: {} and dst: {}", 256 + "{} between src: {} and dst: {}",
......