You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mjsax (via GitHub)" <gi...@apache.org> on 2023/04/04 04:31:13 UTC

[GitHub] [kafka] mjsax opened a new pull request, #13498: MINOR: fix log statement

mjsax opened a new pull request, #13498:
URL: https://github.com/apache/kafka/pull/13498

   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] mjsax commented on a diff in pull request #13498: MINOR: fix log statement

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13498:
URL: https://github.com/apache/kafka/pull/13498#discussion_r1157893712


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1536,7 +1536,7 @@ private Consumer<StreamThread> streamThreadLeaveConsumerGroup(final long remaini
                     removeMembersFromConsumerGroupResult.memberResult(memberToRemove)
                         .get(remainingTimeMs, TimeUnit.MILLISECONDS);
                 } catch (final Exception e) {
-                    log.error("Could not remove static member {} from consumer group {} due to a: {}",
+                    log.error("Could not remove static member {} from consumer group {} due to:",
                         groupInstanceId.get(),
                         applicationConfigs.getString(StreamsConfig.APPLICATION_ID_CONFIG), e);

Review Comment:
   ![Screen Shot 2023-04-04 at 5 22 07 PM](https://user-images.githubusercontent.com/8959638/229950738-d000b29e-83b9-490b-a48c-67aafe8fc0dc.png)
   
   Hmmm... I was actually just reacting to an IntelliJ warning -- seems IntelliJ has a bug.
   
   Closing this PR.



-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] mjsax closed pull request #13498: MINOR: fix log statement

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax closed pull request #13498: MINOR: fix log statement
URL: https://github.com/apache/kafka/pull/13498


-- 
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-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] cadonna commented on a diff in pull request #13498: MINOR: fix log statement

Posted by "cadonna (via GitHub)" <gi...@apache.org>.
cadonna commented on code in PR #13498:
URL: https://github.com/apache/kafka/pull/13498#discussion_r1156908192


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1536,7 +1536,7 @@ private Consumer<StreamThread> streamThreadLeaveConsumerGroup(final long remaini
                     removeMembersFromConsumerGroupResult.memberResult(memberToRemove)
                         .get(remainingTimeMs, TimeUnit.MILLISECONDS);
                 } catch (final Exception e) {
-                    log.error("Could not remove static member {} from consumer group {} due to a: {}",
+                    log.error("Could not remove static member {} from consumer group {} due to:",
                         groupInstanceId.get(),
                         applicationConfigs.getString(StreamsConfig.APPLICATION_ID_CONFIG), e);

Review Comment:
   I guess you want to log the exception, right? If yes, a third pair of curly braces is missing, isn't it? Method `error()` has signatures
   ```
   public void error(String format, Object... arguments);
   ```
   and 
   ```
   public void error(String msg, Throwable t);
   ```
   There is no signature that takes a number of arguments and then a `Throwable`. I pretty sure that would be incorrect java.
   
   My suggestion is:
   ```suggestion
                       log.error("Could not remove static member {} from consumer group {} due to: {}",
                           groupInstanceId.get(),
                           applicationConfigs.getString(StreamsConfig.APPLICATION_ID_CONFIG), 
                           e
                       );
   ```
   or
   ```suggestion
                       log.error("Could not remove static member {} from consumer group {} due to: {}",
                           groupInstanceId.get(), applicationConfigs.getString(StreamsConfig.APPLICATION_ID_CONFIG), e);
   ```
   
   Logging the stacktrace would also be great!



-- 
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-unsubscribe@kafka.apache.org

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