Merge "Bug 5916: He plugin: Wake up statistics collector thread if RPC fails."
authorAbhijit Kumbhare <abhijit.kumbhare@ericsson.com>
Thu, 23 Jun 2016 15:17:56 +0000 (15:17 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 23 Jun 2016 15:17:56 +0000 (15:17 +0000)
applications/statistics-manager/src/main/java/org/opendaylight/openflowplugin/applications/statistics/manager/impl/StatRpcMsgManagerImpl.java

index 1717f3af4d0ca9a26472600ef6c474a788191629..43074a70bf82f626c4abbf2a6665ac7edb11adc3 100644 (file)
@@ -188,6 +188,10 @@ public class StatRpcMsgManagerImpl implements StatRpcMsgManager {
                     String[] multipartRequestName = result.getResult().getClass().getSimpleName().split("(?=\\p{Upper})");
                     LOG.warn("Node [{}] does not support statistics request type : {}",
                             nodeKey.getId(),Joiner.on(" ").join(Arrays.copyOfRange(multipartRequestName, 2, multipartRequestName.length-2)));
+                    if (resultTransId != null) {
+                        resultTransId.setException(
+                            new UnsupportedOperationException());
+                    }
                 } else {
                     if (resultTransId != null) {
                         resultTransId.set(id);
@@ -202,8 +206,10 @@ public class StatRpcMsgManagerImpl implements StatRpcMsgManager {
             @Override
             public void onFailure(final Throwable t) {
                 LOG.warn("Response Registration for Statistics RPC call fail!", t);
+                if (resultTransId != null) {
+                    resultTransId.setException(t);
+                }
             }
-
         }
 
         Futures.addCallback(JdkFutureAdapters.listenInPoolThread(future),new FutureCallbackImpl());