Add missing headers to config, netconf subsystems
[controller.git] / opendaylight / netconf / netconf-util / src / main / java / org / opendaylight / controller / netconf / util / AbstractNetconfSessionNegotiator.java
index e30ce5b47e961f87adccebcce363f2092da9c165..26ea7ceb79d4b78d98ecf42af34d7be87364ffcb 100644 (file)
@@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
 public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionPreferences, S extends NetconfSession>
         extends AbstractSessionNegotiator<NetconfMessage, S> {
 
-    // TODO what time ?
+    // TODO Adjust wait time for negotiation, now is 1 minute ?
     private static final long INITIAL_HOLDTIMER = 1;
 
     private static final Logger logger = LoggerFactory.getLogger(AbstractNetconfSessionNegotiator.class);
@@ -124,8 +124,9 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
                                 "Session was not established after " + timeout);
                         negotiationFailed(cause);
                         changeState(State.FAILED);
-                    } else
+                    } else if(channel.isOpen()) {
                         channel.pipeline().remove(NAME_OF_EXCEPTION_HANDLER);
+                    }
                 }
             }
         }, INITIAL_HOLDTIMER, TimeUnit.MINUTES);