Catch all exception when consume kafka record (#5760)

This commit is contained in:
nileblack 2020-11-07 21:40:36 +08:00 committed by GitHub
parent d625f2905b
commit 1c55781a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 13 deletions

View File

@ -27,6 +27,7 @@ Release Notes.
* Improve Kubernetes service registry for ALS analysis.
* Add health checker for cluster management
* Improve the queryable tags generation. Remove the duplicated tags to reduce the storage payload.
* Fix the threads of the Kafka fetcher exit if some unexpected exceptions happen.
* Fix the excessive timeout period set by the kubernetes-client.
* Fix deadlock problem when using elasticsearch-client-7.0.0.
* Fix storage-jdbc isExists not set dbname.

View File

@ -18,7 +18,6 @@
package org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler;
import com.google.protobuf.InvalidProtocolBufferException;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.utils.Bytes;
@ -67,8 +66,8 @@ public class JVMMetricsHandler implements KafkaHandler {
builder.getMetricsList().forEach(jvmMetric -> {
jvmSourceDispatcher.sendMetric(builder.getService(), builder.getServiceInstance(), jvmMetric);
});
} catch (InvalidProtocolBufferException e) {
log.error("", e);
} catch (Exception e) {
log.error("handle record failed", e);
}
}

View File

@ -18,7 +18,6 @@
package org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler;
import com.google.protobuf.InvalidProtocolBufferException;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.utils.Bytes;
@ -51,8 +50,8 @@ public class MeterServiceHandler implements KafkaHandler {
meterDataCollection.getMeterDataList().forEach(meterData -> processor.read(meterData));
processor.process();
} catch (InvalidProtocolBufferException e) {
log.error("", e);
} catch (Exception e) {
log.error("handle record failed", e);
}
}

View File

@ -18,7 +18,6 @@
package org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler;
import com.google.protobuf.InvalidProtocolBufferException;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.utils.Bytes;
@ -62,8 +61,8 @@ public class ProfileTaskHandler implements KafkaHandler {
snapshotRecord.setTimeBucket(TimeBucket.getRecordTimeBucket(snapshot.getTime()));
RecordStreamProcessor.getInstance().in(snapshotRecord);
} catch (InvalidProtocolBufferException e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error("handle record failed", e);
}
}

View File

@ -19,7 +19,6 @@
package org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler;
import com.google.gson.JsonObject;
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -67,8 +66,8 @@ public class ServiceManagementHandler implements KafkaHandler {
} else {
keepAlive(InstancePingPkg.parseFrom(record.value().get()));
}
} catch (InvalidProtocolBufferException e) {
log.error("", e);
} catch (Exception e) {
log.error("handle record failed", e);
}
}

View File

@ -90,7 +90,7 @@ public class TraceSegmentHandler implements KafkaHandler {
timer.finish();
}
} catch (InvalidProtocolBufferException e) {
log.error(e.getMessage(), e);
log.error("handle record failed", e);
}
}