Browse Source

KAFKA-10611: Merge log error to avoid double error (#9407)

When using an error tracking system, two error log messages result into two different alerts.
It's best to group the logs and have one error with all the information.

For example when using with Sentry, this double line of log.error will create 2 different Issues. One can merge the issues but it will be simpler to have a single error log line.

Signed-off-by: Benoit Maggi <benoit.maggi@gmail.com>

Reviewers: Ewen Cheslack-Postava <me@ewencp.org>, Konstantine Karantasis <k.karantasis@gmail.com>
pull/9440/head
Benoit Maggi 4 years ago committed by GitHub
parent
commit
da6871943f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java

5
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java

@ -184,8 +184,7 @@ abstract class WorkerTask implements Runnable { @@ -184,8 +184,7 @@ abstract class WorkerTask implements Runnable {
execute();
} catch (Throwable t) {
log.error("{} Task threw an uncaught and unrecoverable exception", this, t);
log.error("{} Task is being killed and will not recover until manually restarted", this);
log.error("{} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted", this, t);
throw t;
} finally {
doClose();
@ -456,4 +455,4 @@ abstract class WorkerTask implements Runnable { @@ -456,4 +455,4 @@ abstract class WorkerTask implements Runnable {
return metricGroup;
}
}
}
}

Loading…
Cancel
Save