You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/09/06 09:11:50 UTC

(camel) branch main updated (b44ecb02bef2 -> de59a8a2e42b)

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

davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from b44ecb02bef2 chore: fix camel-opentelemetry-metrics ITs broken by OTel console/logging exporter split
     new 3d9eb4bce3f8 chore: fix TahuDefaultComponent static endpoint cache leaking across tests
     new de59a8a2e42b chore: fix TahuDefaultComponent static endpoint cache leaking across tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/component/tahu/TahuDefaultComponent.java     | 8 +++++++-
 .../org/apache/camel/component/tahu/TahuConfigurationTest.java    | 5 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)


(camel) 01/02: chore: fix TahuDefaultComponent static endpoint cache leaking across tests

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3d9eb4bce3f8972e497f7fd4a40d1bbe2614ccb9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 6 10:51:38 2026 +0200

    chore: fix TahuDefaultComponent static endpoint cache leaking across tests
    
    The endpoints map was static, meaning it was never cleared and was shared
    across all component instances for the lifetime of the JVM. Two tests using
    the same groupId/edgeNode path but different options would collide, with the
    second test getting the first test's cached endpoint.
    
    Make the map instance-level and clear it in doStop() so each CamelContext
    gets its own cache that is cleaned up on shutdown. Also use a distinct
    edgeNode name in checkBasicEdgeNodeOptionsMultipleDevices to avoid colliding
    with checkBasicEdgeNodeOptions in the shared per-class CamelContext.
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../org/apache/camel/component/tahu/TahuDefaultComponent.java     | 8 +++++++-
 .../org/apache/camel/component/tahu/TahuConfigurationTest.java    | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuDefaultComponent.java b/components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuDefaultComponent.java
index f35aa0e065eb..2b3991ae0f0d 100644
--- a/components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuDefaultComponent.java
+++ b/components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuDefaultComponent.java
@@ -31,7 +31,7 @@ import org.apache.camel.util.ObjectHelper;
 
 public abstract class TahuDefaultComponent extends DefaultComponent implements SSLContextParametersAware {
 
-    protected static final ConcurrentMap<String, TahuDefaultEndpoint> endpoints = new ConcurrentHashMap<>();
+    protected final ConcurrentMap<String, TahuDefaultEndpoint> endpoints = new ConcurrentHashMap<>();
 
     @Metadata(label = "advanced")
     TahuConfiguration configuration;
@@ -114,6 +114,12 @@ public abstract class TahuDefaultComponent extends DefaultComponent implements S
         return new TahuConfiguration();
     }
 
+    @Override
+    protected void doStop() throws Exception {
+        endpoints.clear();
+        super.doStop();
+    }
+
     @Override
     public boolean isUseGlobalSslContextParameters() {
         return this.useGlobalSslContextParameters;
diff --git a/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java b/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
index 03d728885fa4..40cb2dc900c8 100644
--- a/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
+++ b/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
@@ -74,14 +74,14 @@ public class TahuConfigurationTest extends CamelTestSupport {
     @Test
     public void checkBasicEdgeNodeOptionsMultipleDevices() throws Exception {
         String uri
-                = TahuConstants.EDGE_NODE_SCHEME + "://Basic/EdgeNode?clientId=client1&primaryHostId=app1&deviceIds=D2,D3,D4";
+                = TahuConstants.EDGE_NODE_SCHEME + "://Basic/EdgeNodeMulti?clientId=client1&primaryHostId=app1&deviceIds=D2,D3,D4";
 
         try (TahuDefaultEndpoint endpoint = TestSupport.resolveMandatoryEndpoint(context, uri, TahuDefaultEndpoint.class)) {
 
             assertThat(endpoint, is(notNullValue()));
             assertThat(endpoint,
                     allOf(hasProperty("groupId", is("Basic")),
-                            hasProperty("edgeNode", is("EdgeNode")),
+                            hasProperty("edgeNode", is("EdgeNodeMulti")),
                             hasProperty("deviceIds", is("D2,D3,D4")),
                             hasProperty("deviceIdList", hasItems("D2", "D3", "D4")),
                             hasProperty("primaryHostId", is("app1")),


(camel) 02/02: chore: fix TahuDefaultComponent static endpoint cache leaking across tests

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit de59a8a2e42b3287976d05255554d09587135258
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 6 10:53:21 2026 +0200

    chore: fix TahuDefaultComponent static endpoint cache leaking across tests
    
    The endpoints map was static, meaning it was never cleared and was shared
    across all component instances for the lifetime of the JVM. Two tests using
    the same groupId/edgeNode path but different options would collide, with the
    second test getting the first test's cached endpoint.
    
    Make the map instance-level and clear it in doStop() so each CamelContext
    gets its own cache that is cleaned up on shutdown. Also use a distinct
    edgeNode name in checkBasicEdgeNodeOptionsMultipleDevices to avoid colliding
    with checkBasicEdgeNodeOptions in the shared per-class CamelContext.
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../java/org/apache/camel/component/tahu/TahuConfigurationTest.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java b/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
index 40cb2dc900c8..cd70f3754218 100644
--- a/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
+++ b/components/camel-tahu/src/test/java/org/apache/camel/component/tahu/TahuConfigurationTest.java
@@ -74,7 +74,8 @@ public class TahuConfigurationTest extends CamelTestSupport {
     @Test
     public void checkBasicEdgeNodeOptionsMultipleDevices() throws Exception {
         String uri
-                = TahuConstants.EDGE_NODE_SCHEME + "://Basic/EdgeNodeMulti?clientId=client1&primaryHostId=app1&deviceIds=D2,D3,D4";
+                = TahuConstants.EDGE_NODE_SCHEME
+                  + "://Basic/EdgeNodeMulti?clientId=client1&primaryHostId=app1&deviceIds=D2,D3,D4";
 
         try (TahuDefaultEndpoint endpoint = TestSupport.resolveMandatoryEndpoint(context, uri, TahuDefaultEndpoint.class)) {