Description
See my description on the list: https://lists.apache.org/thread.html/4aa229421668a92275e33643dbc57f2fea29cee7ffcb07891f58c9eb@%3Cdev.plc4x.apache.org%3E
I created a MWE like that
public static void main(String[] args) throws Exception { IntStream.range(0, 100).parallel().forEach(i -> createConnection(i)); } private static void createConnection(int i) { System.out.println("trying " + i); try (PlcConnection plcConnection = new PlcDriverManager().getConnection("s7://192.168.167.211/0/0")) { } catch (Exception e) { logger.error("Kann keine Verbindung zu der angegebenen Adresse aufbauen"); } }
where the IP is not reachable, thus it fails every time.
When looking at the open sockets with (works on my Mac)
while true; do lsof -p 16843 | wc -l; sleep 10; done
I get the output
1640 1640 1640 1736 1736 1736 1832 1832 1832 1928 1928 1928 2024 2024 2024 2120 2120 2120 2216 2216 2216 2312 2312 2312 2408 2408 2408 2504 2504 2504 2500
So this reall sems to be the case.
I think this could be due to us only propagating the exception but not closing the channel, I will investigate further.
Attachments
Issue Links
- relates to
-
PLC4X-158 Too many open files after less than 24 hours of Scraper use
- Closed
- links to