Skip to content

Conversation

@abedatahub
Copy link
Collaborator

  • Refactored MCLEmitResult
  • Log Kafka publish errors

- Refactored MCLEmitResult
- Log Kafka publish errors
@abedatahub abedatahub requested a review from chakru-r November 5, 2025 02:14
@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment community-contribution PR or Issue raised by member(s) of DataHub Community labels Nov 5, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Nov 5, 2025
aspectSpec.getName(),
entityUrn);
return MCLEmitResult.builder().metadataChangeLog(metadataChangeLog).emitted(false).build();
return MCLEmitResult.notEmitted(metadataChangeLog, true);
Copy link
Collaborator Author

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)

https://vpc-euc1-logs-prod-shared-es-01-be2dv7o6zdiraca5kzvm2znmb4.eu-central-1.es.amazonaws.com/_dashboards/app/data-explorer/discover#?_a=(discover:(columns:!(message,level),isDirty:!t,sort:!()),metadata:(indexPattern:'0f598ad0-b0f4-11ef-b003-2575690fe45c',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2025-10-31T20:33:20.081Z',to:'2025-11-04T21:33:36.626Z'))&_q=(filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'0f598ad0-b0f4-11ef-b003-2575690fe45c',key:kubernetes.namespace_name,negate:!f,params:(query:bf94a93599-superbet),type:phrase),query:(match_phrase:(kubernetes.namespace_name:bf94a93599-superbet))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'0f598ad0-b0f4-11ef-b003-2575690fe45c',key:level,negate:!f,params:(query:ERROR),type:phrase),query:(match_phrase:(level:ERROR)))),query:(language:kuery,query:'%22Failed%20to%20produce%20MCLs%22'))

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)

Copy link
Collaborator

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 {
Copy link
Collaborator Author

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 MCLEmitResult via getProductionResult

@codecov
Copy link

codecov bot commented Nov 5, 2025

Bundle Report

Bundle size has no change ✅

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@datahub-cyborg datahub-cyborg bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Nov 5, 2025
@datahub-cyborg datahub-cyborg bot added merge-pending-ci A PR that has passed review and should be merged once CI is green. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution PR or Issue raised by member(s) of DataHub Community devops PR or Issue related to DataHub backend & deployment merge-pending-ci A PR that has passed review and should be merged once CI is green. product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants