- final BigInteger datapathId = featuresReply != null ? featuresReply.getDatapathId() : BigInteger.ZERO;
- LOG.debug("Actively closing connection: {}, datapathId:{}.",
- connectionAdapter.getRemoteAddress(), datapathId);
- connectionState = ConnectionContext.CONNECTION_STATE.RIP;
-
- Future<Void> future = Executors.newSingleThreadExecutor().submit(new Callable<Void>() {
- @Override
- public Void call() throws Exception {
- unregisterOutboundQueue();
- return null;
- }
- });
- try {
- LOG.debug("Waiting 1s for unregistering outbound queue.");
- future.get(1, TimeUnit.SECONDS);
- LOG.info("Unregistering outbound queue successful.");
- } catch (InterruptedException e) {
- LOG.warn("Unregistering outbound queue was interrupted for node {}", nodeId);
- } catch (ExecutionException e) {
- LOG.warn("Unregistering outbound queue throws exception for node {}", nodeId, e);
- } catch (TimeoutException e) {
- LOG.warn("Unregistering outbound queue took longer than 1 seconds for node {}", nodeId);
+ final BigInteger datapathId = Objects.nonNull(featuresReply) ? featuresReply.getDatapathId() : BigInteger.ZERO;
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Actively closing connection: {}, datapathId: {}",
+ connectionAdapter.getRemoteAddress(), datapathId);