Bug 7764 - Do no throw warning on explicit task cancellation 36/51636/2
authorAnil Vishnoi <vishnoianil@gmail.com>
Thu, 9 Feb 2017 08:12:20 +0000 (00:12 -0800)
committerShuva Jyoti Kar <shuva.jyoti.kar.87@gmail.com>
Fri, 10 Feb 2017 17:04:13 +0000 (17:04 +0000)
Change-Id: I9477823ffd1b4e9b28484ae8cde166a2d03f5a9f
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
(cherry picked from commit d813c7f656b4dd6f460b66a2fa303a448f6a4e07)

openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsManagerImpl.java

index 8f49fd7fe44b8e67fdc9023f91fe682cab97d5b1..7127bb5eda639aa46f17513956ff77511d0639a1 100644 (file)
@@ -18,6 +18,7 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.CancellationException;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.Future;
@@ -164,8 +165,10 @@ public class StatisticsManagerImpl implements StatisticsManager, StatisticsManag
                             deviceInfo.getLOGValue(),throwable);
                     stopScheduling(deviceInfo);
                 } else {
-                    LOG.warn("Unexpected error occurred during statistics collection for node {}, rescheduling " +
-                            "statistics collections", deviceInfo.getLOGValue(),throwable);
+                    if (!(throwable instanceof CancellationException)) {
+                        LOG.warn("Unexpected error occurred during statistics collection for node {}, rescheduling " +
+                                "statistics collections", deviceInfo.getLOGValue(),throwable);
+                    }
                     scheduleNextPolling(deviceState, deviceInfo, statisticsContext, timeCounter);
                 }
             }