From: Jason Ye Date: Thu, 25 Apr 2013 22:06:56 +0000 (+0000) Subject: Merge "Logging and Code clean-up for protocol_plugins.core Change-Id: Ia34dd373ba16d7... X-Git-Tag: releasepom-0.1.0~527 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=9b161b44607c305c5f36797fb2567dde1a445c14;hp=d4526d295217d6d6d60434e179a2a78c1b2eb52b Merge "Logging and Code clean-up for protocol_plugins.core Change-Id: Ia34dd373ba16d7a70be0440d7f076e7dab02ffdd" --- diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java index 4d3dca1878..d473a462c4 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java @@ -445,7 +445,20 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService, xid = errorMsg.getXid(); } - long rid = getMessageRid(sw.getId(), xid); + Long rid = getMessageRid(sw.getId(), xid); + /* + * Null or zero requestId indicates that the error message is meant for + * a sync message. It will be handled by the sync message worker thread. + * Hence we are done here. + */ + if ((rid == null) || (rid == 0)) { + return; + } + + /* + * Notifies the caller that error has been reported for a previous flow + * programming request + */ for (Map.Entry containerNotifier : flowProgrammerNotifiers .entrySet()) { IFlowProgrammerNotifier notifier = containerNotifier.getValue(); @@ -585,10 +598,14 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService, * The OF message xid * @return The Request ID */ - public long getMessageRid(long swid, int xid) { + private Long getMessageRid(long swid, Integer xid) { + Long rid = null; + + if (xid == null) { + return rid; + } + Map swxid2rid = this.xid2rid.get(swid); - long rid = 0; - if (swxid2rid != null) { rid = swxid2rid.get(xid); }