[improve](routine-load) optimize error msg when failed to fetch Kafka info #30298

This commit is contained in:
HHoflittlefish777
2024-01-25 14:08:40 +08:00
committed by yiguolei
parent 0f81ecf415
commit 92d4ce31ae
2 changed files with 48 additions and 3 deletions

View File

@ -325,13 +325,15 @@ public class KafkaRoutineLoadJob extends RoutineLoadJob {
try {
this.newCurrentKafkaPartition = getAllKafkaPartitions();
} catch (Exception e) {
String msg = e.getMessage()
+ " may be Kafka properties set in job is error"
+ " or no partition in this topic that should check Kafka";
LOG.warn(new LogBuilder(LogKey.ROUTINE_LOAD_JOB, id)
.add("error_msg", "Job failed to fetch all current partition with error " + e.getMessage())
.add("error_msg", msg)
.build(), e);
if (this.state == JobState.NEED_SCHEDULE) {
unprotectUpdateState(JobState.PAUSED,
new ErrorReason(InternalErrorCode.PARTITIONS_ERR,
"Job failed to fetch all current partition with error " + e.getMessage()),
new ErrorReason(InternalErrorCode.PARTITIONS_ERR, msg),
false /* not replay */);
}
}