X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2FNetconfSessionPromise.java;h=178be8bfe1f3ef13ec748eb6c2c39aad2af929f7;hb=77cedd1e445f7efc325c185aca8c41fe3b6d606b;hp=d7722fe3bcad1f0a2c921ed97b41cb01e9e0d62a;hpb=4c49398a85911278e3a5ac5a6ce3d5f3261b65a6;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/NetconfSessionPromise.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/NetconfSessionPromise.java index d7722fe3bc..178be8bfe1 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/NetconfSessionPromise.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/NetconfSessionPromise.java @@ -43,11 +43,18 @@ final class NetconfSessionPromise extends DefaultPromi @SuppressWarnings("checkstyle:illegalCatch") synchronized void connect() { + final int timeout; try { - final int timeout = strategy.getConnectTimeout(); + timeout = strategy.getConnectTimeout(); + } catch (Exception e) { + LOG.info("Connection to {} aborted due to strategy decision", address, e); + setFailure(e); + return; + } - LOG.debug("Promise {} attempting connect for {}ms", this, timeout); + LOG.debug("Promise {} attempting connect for {}ms", this, timeout); + try { if (address.isUnresolved()) { address = new InetSocketAddress(address.getHostName(), address.getPort()); }