Fix HashedWheelTimer exception for short living netconf clients. 64/3864/1
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 20 Dec 2013 10:05:13 +0000 (11:05 +0100)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 20 Dec 2013 10:05:13 +0000 (11:05 +0100)
An exception occurred in logs for short living netconf clients created by config persister.
These clients were closed before their initial check timer ran out.

Change-Id: Ic2c998d17788c9b92b72800415fd1ee068611f84
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/AbstractNetconfSessionNegotiator.java

index e30ce5b47e961f87adccebcce363f2092da9c165..4fee930eff7db3c3ecfe5beb0bd113c9acfd5366 100644 (file)
@@ -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);