Hi Dirk, First, of all: Welcome to the coolest list Apache has to offer :-) I hope this is going to be the start of a great journey, with us :-)
I had to moderate your email through, as it seems you are not subscribed to this list … please do so, by sending an empty email to [email protected]<mailto:[email protected]> so you can get all the other replies. Now to your question: The problem is, if you have a pooled connection and you call close on that, it doesn’t close the connection, but puts it back into the pool/cache. I think there usually was something to close down the pool, but it’s been quite some time since I worked with the Java part of PLC4X (Well … worked WITH it … I sort of work ON it all the time ;-)) I hope someone else on the list will be able to help you. And if the help is, telling you it currently doesn’t work. We’ll do everything we can to, help you fix it yourself or perhaps someone already knows how to fix it. Chris From: Dirk Lorenz <[email protected]> Date: Saturday, 26. November 2022 at 16:01 To: [email protected] <[email protected]> Subject: PLC4J API Bug (possibly in PlcDriverManager) Hi guys, I have been playing around with using PLC4J (v0.9.1, v0.10.0) to connect to a Beckhoff PLC in Java when I realized that my program never finishes. After a little time debugging I saw that during destruction not all threads are being terminated causing the program to starve. [cid:[email protected]] All those remaining threads are somehow connected to the thread pool. I explicitly called close on the connection and set all objects to NULL without any effect. Moreover, I'm missing a method on the driver manager to retrieve or to close all connections. At that point I'm pretty stuck with this problem and the only option would be to dive deep into implementation of the library. I haven't been cross checking if the problem also occurs with a S7 connection. But since this code (using DefaultNettyPlcConnection) is pretty generic and not specific to the driver I believe this is a general issue. But I could also be wrong and it could be related to some missing code in AdsProtocolLogic. [cid:[email protected]] Attached to the mail I'm sending the debug log file. On request I can send you the Java project, too. Regards Dirk -- [cid:[email protected]]
