This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new eea46e1c9b fix: Ensured the idleTimer of cached connections is 
correctly cancelled when closing the ConnectionContainer.
eea46e1c9b is described below

commit eea46e1c9b8afe4c654dccd95373147acee88e0d
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Aug 21 08:56:24 2025 +0200

    fix: Ensured the idleTimer of cached connections is correctly cancelled 
when closing the ConnectionContainer.
---
 .../java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/plc4j/tools/connection-cache/src/main/java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java
 
b/plc4j/tools/connection-cache/src/main/java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java
index a64995a99b..a40e722699 100644
--- 
a/plc4j/tools/connection-cache/src/main/java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java
+++ 
b/plc4j/tools/connection-cache/src/main/java/org/apache/plc4x/java/utils/cache/ConnectionContainer.java
@@ -71,6 +71,12 @@ class ConnectionContainer {
         // Clear the queue.
         queue.clear();
 
+        // Stop the idle timer.
+        if(idleTimer != null) {
+            idleTimer.cancel();
+            idleTimer.purge();
+        }
+
         // If the connection is currently used, close it.
         if(leasedConnection != null) {
             try {

Reply via email to