-
Notifications
You must be signed in to change notification settings - Fork 14.8k
MINOR: Include exception objects when logging group coordinator errors #20806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chia7712
merged 2 commits into
apache:trunk
from
confluentinc:squah-group-coordinator-exception-logging
Nov 6, 2025
+11
−11
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,7 +399,7 @@ public void run() { | |
| schedule(key, retryBackoff, TimeUnit.MILLISECONDS, true, retryBackoff, operation); | ||
| } else { | ||
| log.error("The write event {} for the timer {} failed due to {}. Ignoring it. ", | ||
| event.name, key, ex.getMessage()); | ||
| event.name, key, ex.getMessage(), ex); | ||
| } | ||
|
|
||
| return null; | ||
|
|
@@ -717,7 +717,7 @@ private void load() { | |
| } | ||
| } catch (Throwable ex) { | ||
| log.error("Failed to load metadata from {} with epoch {} due to {}.", | ||
| tp, epoch, ex.toString()); | ||
| tp, epoch, ex.toString(), ex); | ||
| context.transitionTo(CoordinatorState.FAILED); | ||
| } | ||
| } else { | ||
|
|
@@ -820,7 +820,7 @@ private void flushCurrentBatch() { | |
| // Free up the current batch. | ||
| freeCurrentBatch(); | ||
| } catch (Throwable t) { | ||
| log.error("Writing records to {} failed due to: {}.", tp, t.getMessage()); | ||
| log.error("Writing records to {} failed due to: {}.", tp, t.getMessage(), t); | ||
| failCurrentBatch(t); | ||
| // We rethrow the exception for the caller to handle it too. | ||
| throw t; | ||
|
|
@@ -1057,7 +1057,7 @@ private void append( | |
| currentBatch.builder.append(recordToAppend); | ||
| currentBatch.nextOffset++; | ||
| } catch (Throwable t) { | ||
| log.error("Replaying record {} to {} failed due to: {}.", recordToReplay, tp, t.getMessage()); | ||
| log.error("Replaying record {} to {} failed due to: {}.", recordToReplay, tp, t.getMessage(), t); | ||
|
|
||
| // Add the event to the list of pending events associated with the last | ||
| // batch in order to fail it too. | ||
|
|
@@ -2446,7 +2446,7 @@ public void scheduleUnloadOperation( | |
| // It's very unlikely that we will ever see an exception here, since we | ||
| // already make an effort to catch exceptions in the unload method. | ||
| log.error("Failed to unload metadata for {} with epoch {} due to {}.", | ||
| tp, partitionEpoch, ex.toString()); | ||
| tp, partitionEpoch, ex.toString(), ex); | ||
|
||
| } finally { | ||
| // Always remove the coordinator context, otherwise the coordinator | ||
| // shard could be permanently stuck. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the whole exception
exis logged, changingex.toString()toex.getMessage()would eliminate a lot of redundant information in the logThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing! I've updated the PR to use
getMessageinstead.