[
https://issues.apache.org/jira/browse/KAFKA-7353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16605207#comment-16605207
]
ASF GitHub Bot commented on KAFKA-7353:
---------------------------------------
ewencp closed pull request #5583: KAFKA-7353; Connect logs 'this' for anonymous
inner classes
URL: https://github.com/apache/kafka/pull/5583
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
index 611e196d9de..55d4860b2e6 100644
---
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
+++
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
@@ -89,7 +89,7 @@ public void requestTaskReconfiguration() {
@Override
public void raiseError(Exception e) {
- log.error("{} Connector raised an error", this, e);
+ log.error("{} Connector raised an error",
WorkerConnector.this, e);
onFailure(e);
ctx.raiseError(e);
}
diff --git
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
index 692331ed13f..39e0c6d53f6 100644
---
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
+++
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
@@ -649,7 +649,7 @@ public void onPartitionsAssigned(Collection<TopicPartition>
partitions) {
long pos = consumer.position(tp);
lastCommittedOffsets.put(tp, new OffsetAndMetadata(pos));
currentOffsets.put(tp, new OffsetAndMetadata(pos));
- log.debug("{} Assigned topic partition {} with offset {}",
this, tp, pos);
+ log.debug("{} Assigned topic partition {} with offset {}",
WorkerSinkTask.this, tp, pos);
}
sinkTaskMetricsGroup.assignedOffsets(currentOffsets);
diff --git
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
index 70d0cf9d7ae..623a210e0e2 100644
---
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
+++
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
@@ -326,11 +326,11 @@ public void onCompletion(RecordMetadata recordMetadata,
Exception e) {
// timeouts, callbacks with exceptions
should never be invoked in practice. If the
// user overrode these settings, the best
we can do is notify them of the failure via
// logging.
- log.error("{} failed to send record to {}:
{}", this, topic, e);
- log.debug("{} Failed record: {}", this,
preTransformRecord);
+ log.error("{} failed to send record to {}:
{}", WorkerSourceTask.this, topic, e);
+ log.debug("{} Failed record: {}",
WorkerSourceTask.this, preTransformRecord);
} else {
log.trace("{} Wrote record successfully:
topic {} partition {} offset {}",
- this,
+ WorkerSourceTask.this,
recordMetadata.topic(),
recordMetadata.partition(),
recordMetadata.offset());
commitTaskRecord(preTransformRecord);
@@ -454,9 +454,9 @@ public boolean commitOffsets() {
@Override
public void onCompletion(Throwable error, Void result) {
if (error != null) {
- log.error("{} Failed to flush offsets to storage: ", this,
error);
+ log.error("{} Failed to flush offsets to storage: ",
WorkerSourceTask.this, error);
} else {
- log.trace("{} Finished flushing offsets to storage", this);
+ log.trace("{} Finished flushing offsets to storage",
WorkerSourceTask.this);
}
}
});
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Connect logs 'this' for anonymous inner classes
> -----------------------------------------------
>
> Key: KAFKA-7353
> URL: https://issues.apache.org/jira/browse/KAFKA-7353
> Project: Kafka
> Issue Type: Bug
> Components: KafkaConnect
> Affects Versions: 1.0.2, 1.1.1, 2.0.0
> Reporter: Kevin Lafferty
> Priority: Minor
> Fix For: 1.0.3, 1.1.2, 2.0.1, 2.1.0
>
>
> Some classes in the Kafka Connect runtime create anonymous inner classes that
> log 'this', resulting in log messages that can't be correlated with any other
> messages. These should scope 'this' to the outer class to have consistent log
> messages.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)