Skip to content

KAFKA-19499: Corrected the logger name in PersisterStateManagerHandler #20175

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
merged 3 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ private CompletableFuture<ShareGroupHeartbeatResponseData> handlePersisterInitia
}
return performShareGroupStateMetadataInitialize(groupId, topicPartitionMap, defaultResponse);
}
log.error("Received error while calling initialize state for {} on persister {}.", groupId, persisterError.code());
log.error("Received error while calling initialize state for {} on persister, errorCode: {}.", groupId, persisterError.code());
return uninitializeShareGroupState(persisterError, groupId, topicPartitionMap);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void setGenerateCallback(Runnable generateCallback) {
public abstract class PersisterStateManagerHandler implements RequestCompletionHandler {
protected Node coordinatorNode;
private final BackoffManager findCoordBackoff;
protected final Logger log = LoggerFactory.getLogger(getClass());
protected final Logger log;
private Consumer<ClientResponse> onCompleteCallback;
protected final SharePartitionKey partitionKey;

Expand All @@ -237,6 +237,11 @@ public PersisterStateManagerHandler(
this.onCompleteCallback = response -> {
}; // noop
partitionKey = SharePartitionKey.getInstance(groupId, topicId, partition);
String canonicalName = getClass().getCanonicalName();
if (canonicalName == null) {
canonicalName = getClass().getName();
}
log = LoggerFactory.getLogger(canonicalName);
Comment on lines +240 to +244
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probaly can do later as well. Becuase now it's not always the canonical name in the variable.

Suggested change
String canonicalName = getClass().getCanonicalName();
if (canonicalName == null) {
canonicalName = getClass().getName();
}
log = LoggerFactory.getLogger(canonicalName);
String name = getClass().getCanonicalName();
if (name == null) {
name = getClass().getName();
}
log = LoggerFactory.getLogger(name);

}

/**
Expand Down