gnodet-bot commented on code in PR #30488:
URL: https://github.com/apache/camel/pull/30488#discussion_r4641017964


##########
components/camel-kudu/src/test/java/org/apache/camel/component/kudu/IntegrationKuduConfiguration.java:
##########
@@ -138,6 +140,18 @@ private void startContainers() {
         LOG.info("Kudu tablet server RPC accessible at {}:{}", 
tabletContainer.getHost(), KUDU_TABLET_RPC_PORT);
 
         kuduClient = new KuduClient.KuduClientBuilder(masterAuthority).build();
+        awaitClusterReady();
+    }
+
+    /**
+     * A listening RPC port does not mean the cluster is usable: the master 
must have elected itself leader and the
+     * tablet server must have registered, otherwise operations such as create 
table keep retrying until they time out.
+     */
+    private void awaitClusterReady() {
+        await().atMost(60, TimeUnit.SECONDS)
+                .pollInterval(500, TimeUnit.MILLISECONDS)
+                .ignoreExceptions()

Review Comment:
   `ignoreExceptions()` swallows **all** exception types including 
`RuntimeException` and `Error`. In the current lambda 
(`kuduClient.listTabletServers()`) the only exceptions thrown are 
`KuduException` (a checked exception), so this is not a bug. Worth narrowing 
for defense-in-depth, since any future change to the lambda body would have 
unexpected exceptions silently swallowed:
   
   ```suggestion
                   
.ignoreExceptionsInstanceOf(org.apache.kudu.client.KuduException.class)
   ```
   
   Not blocking — the current code is correct for the current lambda.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to