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

jmckenzie pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-analytics.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d8ad5773 CASSANALYTICS-145: Add exception stack walking to port 
mapping retry logic on analytics integration tests (#191)
d8ad5773 is described below

commit d8ad57738ed392be2c59ac7589a29832e82d2d5b
Author: Josh McKenzie <[email protected]>
AuthorDate: Thu Apr 9 12:56:57 2026 -0400

    CASSANALYTICS-145: Add exception stack walking to port mapping retry logic 
on analytics integration tests (#191)
    
    Patch by Josh McKenzie; reviewed by Arjun Ashok and Shailaja Koppu for 
CASSANALYTICS-145
---
 .../testing/SharedClusterIntegrationTestBase.java      | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git 
a/cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/SharedClusterIntegrationTestBase.java
 
b/cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/SharedClusterIntegrationTestBase.java
index a81b7df9..460d8565 100644
--- 
a/cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/SharedClusterIntegrationTestBase.java
+++ 
b/cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/SharedClusterIntegrationTestBase.java
@@ -217,8 +217,22 @@ public abstract class SharedClusterIntegrationTestBase
             }
             catch (RuntimeException rte)
             {
-                if (rte.getMessage() != null && 
(rte.getMessage().contains("Address already in use") ||
-                                                 rte.getMessage().contains("is 
in use by another")))
+                // The BindException ("Address already in use") is several 
levels deep in the cause
+                // chain when thrown through the reflection-based cluster 
provisioning path, so we
+                // must walk the full chain rather than checking only 
rte.getMessage().
+                boolean isBindFailure = false;
+                for (Throwable cause = rte; cause != null; cause = 
cause.getCause())
+                {
+                    String message = cause.getMessage();
+                    if (message != null && (message.contains("Address already 
in use") ||
+                                            message.contains("is in use by 
another") ||
+                                            message.contains("Failed to bind 
port")))
+                    {
+                        isBindFailure = true;
+                        break;
+                    }
+                }
+                if (isBindFailure)
                 {
                     logger.warn("Failed to provision cluster after {} 
retries", retry, rte);
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to