vvcephei commented on code in PR #13534:
URL: https://github.com/apache/kafka/pull/13534#discussion_r1163018118


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java:
##########
@@ -1195,13 +1195,8 @@ public boolean commitNeeded() {
                         commitNeeded = true;
                         entry.setValue(offset - 1);
                     }
-                } catch (final TimeoutException error) {
-                    // the `consumer.position()` call should never block, 
because we know that we did process data
-                    // for the requested partition and thus the consumer 
should have a valid local position
-                    // that it can return immediately
-
-                    // hence, a `TimeoutException` indicates a bug and thus we 
rethrow it as fatal `IllegalStateException`
-                    throw new IllegalStateException(error);
+                } catch (final TimeoutException swallow) {
+                    log.debug("Could not get consumer position for partition 
{} due to: {}", partition, swallow);

Review Comment:
   This won't print the exception. It's using 
https://www.javadoc.io/static/org.slf4j/slf4j-api/1.7.30/org/slf4j/Logger.html#debug-java.lang.String-java.lang.Object-java.lang.Object-
 , but the intent is probably to use 
https://www.javadoc.io/static/org.slf4j/slf4j-api/1.7.30/org/slf4j/Logger.html#debug-java.lang.String-java.lang.Throwable-
 , which requires a fully constructed string as the first arg.
   
   ```suggestion
                       log.debug(String.format("Could not get consumer position 
for partition %d", partition), swallow);
   ```



-- 
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