bbejeck commented on code in PR #20661:
URL: https://github.com/apache/kafka/pull/20661#discussion_r2415129634
##########
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java:
##########
@@ -524,17 +525,41 @@ public void handleResponse(PushTelemetryResponse
response) {
lock.writeLock().unlock();
}
}
+
+ private boolean isRetryable(final KafkaException maybeFatalException) {
+ if (maybeFatalException == null) {
+ return true;
+ }
+
+ Throwable cause;
+ if (maybeFatalException.getClass() == KafkaException.class) {
+ if (maybeFatalException.getCause() == null) {
+ return false;
+ } else {
+ cause = maybeFatalException.getCause();
+ }
+ } else {
+ cause = maybeFatalException;
+ }
+ while (cause != null) {
+ if (!(cause instanceof RetriableException)) {
+ return false;
+ }
Review Comment:
True, but I wanted to be conservative as it could be possible (while not
probable) that could be a fatal exception nested in retriable one. Like I
said, not very likely at all, but I think it's worth the coverage.
--
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]