commit | a683b079a7f5627cad375bfa8520a2c483c08a75 | [log] [tgz] |
---|---|---|
author | zhongguo zhao <zhao_zhong_guo@sina.com> | Mon Aug 27 16:32:33 2018 +0800 |
committer | zhongguo zhao <zhao_zhong_guo@sina.com> | Mon Aug 27 16:33:06 2018 +0800 |
tree | 367b951516e41795ebc89bbbddaf844840e1b38e | |
parent | 304426de24cc2db3ddcb329d22dae6916e5c2a48 [diff] |
fix too many open files Change-Id: Ic805a8eaeee5419fdf7a5b5490d5b6c2c5ccc00f
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java index e0959cd..75dce05 100644 --- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java +++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java
@@ -315,10 +315,7 @@ l.deviceRemoved(deviceId); } } else { - netconfDeviceMap.remove(deviceId); - for (NetconfDeviceListener l : netconfDeviceListeners) { - l.deviceRemoved(deviceId); - } + stopDevice(deviceId, true); } }
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java index 6866423..147ea04 100644 --- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java +++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfSessionMinaImpl.java
@@ -699,6 +699,23 @@ return false; } + @Override + public boolean close() throws NetconfException { + try { + return super.close(); + } catch (IOException ioe) { + throw new NetconfException(ioe.getMessage()); + } finally { + try { + session.close(); + channel.close(); + client.close(); + } catch (IOException ioe) { + log.warn("Error closing session {} on {}", sessionID, deviceInfo, ioe); + } + } + } + protected void publishEvent(NetconfDeviceOutputEvent event) { primaryListeners.forEach(lsnr -> { if (lsnr.isRelevant(event)) {