BUG: jira NETCONF-493 ReconnectPromise throws IllegalStateException continuously 75/66775/3
author李国胜10121395 <li.guosheng6@zte.com.cn>
Wed, 27 Dec 2017 11:50:04 +0000 (19:50 +0800)
committerJakubToth <jakub.toth@pantheon.tech>
Mon, 8 Jan 2018 16:53:41 +0000 (16:53 +0000)
ReconnectPromise will execute method setFailure() more than once
if reconnecting to a netconf device failed more than once, and the
setFailure() method will start throwing IllegalStateException at
the second time invocation, so there should add limitation to the
call of setFailure() to avoid IllegalStateException.

Change-Id: I2d6802e6ac643215192527319d565da36a16caf5
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
protocol-framework/src/main/java/org/opendaylight/protocol/framework/ReconnectPromise.java

index f9fadb04b0e0c19b8d89444883c71ac0d58a1a5e..f449b51d0deff211b5469e56f4504ea4788e0bbc 100644 (file)
@@ -54,7 +54,7 @@ final class ReconnectPromise<S extends ProtocolSession<?>, L extends SessionList
         });
 
         pending.addListener((GenericFutureListener<Future<Object>>) future -> {
-            if (!future.isSuccess()) {
+            if (!future.isSuccess() && !ReconnectPromise.this.isDone()) {
                 ReconnectPromise.this.setFailure(future.cause());
             }
         });