Release semaphore after disconnection
[netconf.git] / plugins / netconf-client-mdsal / src / main / java / org / opendaylight / netconf / client / mdsal / NetconfDeviceCommunicator.java
index 5c16c12e880d8bc824d49efe3a62df4901af850f..5fa15b39b57ec3d4c57424084870a102c3f956cf 100644 (file)
@@ -166,6 +166,11 @@ public class NetconfDeviceCommunicator implements NetconfClientSessionListener,
                     if (r.future.isUncancellable()) {
                         futuresToCancel.add(r.future);
                         it.remove();
+                        // we have just removed one request from the queue
+                        // we can also release one permit
+                        if (semaphore != null) {
+                            semaphore.release();
+                        }
                     } else if (r.future.isCancelled()) {
                         // This just does some house-cleaning
                         it.remove();