-
Notifications
You must be signed in to change notification settings - Fork 3.3k
refactor(error-logging): Improve kafka error logging #15204
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
base: master
Are you sure you want to change the base?
Conversation
abedatahub
commented
Nov 5, 2025
- Refactored MCLEmitResult
- Log Kafka publish errors
- Refactored MCLEmitResult - Log Kafka publish errors
| aspectSpec.getName(), | ||
| entityUrn); | ||
| return MCLEmitResult.builder().metadataChangeLog(metadataChangeLog).emitted(false).build(); | ||
| return MCLEmitResult.notEmitted(metadataChangeLog, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chakru-r The original exception seems to have been thrown from line 1384
if (!failedMCLs.isEmpty()) {
log.error(
"Failed to produce MCLs: {}",
failedMCLs.stream()
.map(result -> result.getMetadataChangeLog().getEntityUrn())
.collect(Collectors.toList()));
// TODO restoreIndices?
throw new RuntimeException("Failed to produce MCLs");
}
The error message:
MCP Processor Error
java.lang.RuntimeException: Failed to produce MCLs
at com.linkedin.metadata.entity.EntityServiceImpl.lambda$emitMCL$57(EntityServiceImpl.java:1329)
Not sure why we didn't see the preceding log statement however. What am I missing?
(And yes, I still haven't added a statement to log the kafka produce failure yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its about 0.5 seconds earlier -- there are quite a bit of logs in between, so filtered for ERROR
| @Getter | ||
| @ToString | ||
| @EqualsAndHashCode | ||
| public final class MCLEmitResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to achieve a few different results with this refactoring:
- better docs for states
- better validation; prevent invalid combinations
- move the responsibility for logging to the caller of
MCLEmitResultviagetProductionResult
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |