Change-Id: I7153553ce2710f8b197f5520fe4862bcef314efb
Signed-off-by: Miroslav Toth <mirtoth@cisco.com>
LOG.trace("Built SMR packet: " + mrb.build().toString());
scheduler = new SmrScheduler();
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);
}
addSubscribers(eid, subscribers);
}
private Map<IpAddressBinary, ScheduledFuture<?>> subscriberFutureMap = new HashMap<>();
private long smrNonce;
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();
executor = Executors.newSingleThreadScheduledExecutor();
smrNonce = mrb.getNonce();
future.cancel(false);
LOG.trace("SMR-invoked MapRequest received, scheduled task for subscriber {} with nonce {} has "
+ "been canceled", subscriberAddress.toString(), smrNonce);
future.cancel(false);
LOG.trace("SMR-invoked MapRequest received, scheduled task for subscriber {} with nonce {} has "
+ "been canceled", subscriberAddress.toString(), smrNonce);
- tryToShutDownExecutor();
LOG.trace("Cancelling execution of a SMR Map-Request after {} failed attempts.",
executionCount - 1);
subscriberFutureMap.get(subscriberAddress).cancel(false);
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);
}
} catch (Exception e) {
LOG.error("Errors encountered while handling SMR:", e);