Reliable SMR - executor shutdown update 56/47056/1
authorMiroslav Toth <mirtoth@cisco.com>
Tue, 18 Oct 2016 08:45:38 +0000 (10:45 +0200)
committerMiroslav Toth <mirtoth@cisco.com>
Tue, 18 Oct 2016 08:45:38 +0000 (10:45 +0200)
Change-Id: I7153553ce2710f8b197f5520fe4862bcef314efb
Signed-off-by: Miroslav Toth <mirtoth@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/lisp/MapServer.java

index b65c7f38aec4d2c16309d29c7d0ac3e14d0ae5ee..59f868bfe0d908b85fc8a94061b6cdf3ed0dc966 100644 (file)
@@ -246,11 +246,7 @@ public class MapServer implements IMapServerAsync, OdlMappingserviceListener, IS
         LOG.trace("Built SMR packet: " + mrb.build().toString());
 
         scheduler = new SmrScheduler();
-        try {
-            scheduler.scheduleSmrs(mrb, subscribers.iterator());
-        } catch (InterruptedException e) {
-            LOG.error("SMR Scheduler interrupted.", e);
-        }
+        scheduler.scheduleSmrs(mrb, subscribers.iterator());
         addSubscribers(eid, subscribers);
     }
 
@@ -313,7 +309,7 @@ public class MapServer implements IMapServerAsync, OdlMappingserviceListener, IS
         private Map<IpAddressBinary, ScheduledFuture<?>> subscriberFutureMap = new HashMap<>();
         private long smrNonce;
 
-        void scheduleSmrs(MapRequestBuilder mrb, Iterator<SubscriberRLOC> subscribers) throws InterruptedException {
+        void scheduleSmrs(MapRequestBuilder mrb, Iterator<SubscriberRLOC> subscribers) {
             executor = Executors.newSingleThreadScheduledExecutor();
             smrNonce = mrb.getNonce();
 
@@ -341,7 +337,6 @@ public class MapServer implements IMapServerAsync, OdlMappingserviceListener, IS
                     future.cancel(false);
                     LOG.trace("SMR-invoked MapRequest received, scheduled task for subscriber {} with nonce {} has "
                             + "been canceled", subscriberAddress.toString(), smrNonce);
-                    tryToShutDownExecutor();
                 }
             }
         }
@@ -374,7 +369,6 @@ public class MapServer implements IMapServerAsync, OdlMappingserviceListener, IS
                         LOG.trace("Cancelling execution of a SMR Map-Request after {} failed attempts.",
                                 executionCount - 1);
                         subscriberFutureMap.get(subscriberAddress).cancel(false);
-                        tryToShutDownExecutor();
                     }
                 } catch (Exception e) {
                     LOG.error("Errors encountered while handling SMR:", e);