k-raina commented on code in PR #20144:
URL: https://github.com/apache/kafka/pull/20144#discussion_r2254399569


##########
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java:
##########
@@ -713,14 +716,20 @@ private Optional<Builder<?>> 
createPushRequest(ClientTelemetrySubscription local
                 return Optional.empty();
             }
 
-            CompressionType compressionType = 
ClientTelemetryUtils.preferredCompressionType(localSubscription.acceptedCompressionTypes());
+            CompressionType compressionType = 
ClientTelemetryUtils.preferredCompressionType(localSubscription.acceptedCompressionTypes(),
 unsupportedCompressionTypes);
             ByteBuffer compressedPayload;
             try {
                 compressedPayload = ClientTelemetryUtils.compress(payload, 
compressionType);
-            } catch (Throwable e) {
-                log.debug("Failed to compress telemetry payload for 
compression: {}, sending uncompressed data", compressionType);
-                compressedPayload = ByteBuffer.wrap(payload.toByteArray());
-                compressionType = CompressionType.NONE;
+            } catch (Throwable e) { 
+                if (e instanceof IOException || e instanceof 
NoClassDefFoundError || 
+                        e.getCause() instanceof NoClassDefFoundError) {
+                    log.debug("Failed to compress telemetry payload for 
compression: {}, sending uncompressed data", compressionType);
+                    unsupportedCompressionTypes.add(compressionType);
+                    compressedPayload = ByteBuffer.wrap(payload.toByteArray());
+                    compressionType = CompressionType.NONE;
+                } else {
+                    throw new RuntimeException("Unexpected compression error", 
e);

Review Comment:
   Current workflow: 
   - Exception gets wrapped in RuntimeException("Unexpected compression error")
   - Propagates up through: createPushRequest() → createRequest() → 
NetworkClient.maybeUpdate() → Sender.runOnce()
   - No try-catch blocks in the call chain until Sender.run() where it's logged 
and swallowed
   - Producer keeps sending messages, however telemetry is stuck into 
PUSH_IN_PROGRESS state 
   
   
   I have updated workflow in latest changes (via 
[code](https://github.com/apache/kafka/pull/20144/files#diff-5618c3b2c71f8abbfd21cb2657e78669047ffa4ba0937e9b409e1ce770a3dd89R384-R405)).
 New Workflow:
   - Exception gets wrapped in RuntimeException("Unexpected compression error") 
   - Propagates up through: createPushRequest() → createRequest()
   - In createRequest(), Telemetry state is set as TERMINATED, to correctly 
depict telemetry is disabled. 
   
   
   



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to