Skip to content
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

Add retries to JavaEntityClient:deleteReferencesTo #8268

Conversation

joshuaeilers
Copy link
Contributor

@joshuaeilers joshuaeilers commented Jun 20, 2023

Since we suspect failing calls to deleteReferencesTo (there may be other places) this PR adds retry logic. Normally, retries would not be the best thing to do here, but since we don't have a great way to rollback resolvers on failure at the moment this may help reduce the frequency of data inconsistencies. Also address other places we may not be catching all exceptions in runAsync so we get better logging.

Could use some pointers on testing / appropriate way to structure this.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@joshuaeilers joshuaeilers marked this pull request as ready for review June 20, 2023 22:30
@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Jun 20, 2023
@joshuaeilers joshuaeilers force-pushed the je--retry-deleteEntityReferences branch from daa1a2a to fa60ed6 Compare June 20, 2023 22:46
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! this is looking great. here's an example PR doing a very similar thing that you can use as a model to add a test or two: https://github.com/datahub-project/datahub/pull/8172/files

try {
return block.get();
} catch (Throwable ex) {
MetricUtils.counter(JavaEntityClient.class, "exception" + MetricUtils.DELIMITER + ex.getClass().getName().toLowerCase()).inc();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on this counter?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo love the counter. it might be nice to know what exactly is failing instead of just the name of the exception class.

what do you think about passing a method name or something to track with this counter into withRetry? so here it could be like delete_references_to_failures or something - and it could be optional so if they don't provide a metric name we could just pass in the exception class like you're doing

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! one suggestion but not blocking approval - around name we pass into the counter you added

try {
return block.get();
} catch (Throwable ex) {
MetricUtils.counter(JavaEntityClient.class, "exception" + MetricUtils.DELIMITER + ex.getClass().getName().toLowerCase()).inc();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo love the counter. it might be nice to know what exactly is failing instead of just the name of the exception class.

what do you think about passing a method name or something to track with this counter into withRetry? so here it could be like delete_references_to_failures or something - and it could be optional so if they don't provide a metric name we could just pass in the exception class like you're doing

@joshuaeilers joshuaeilers enabled auto-merge (squash) June 22, 2023 19:53
@joshuaeilers joshuaeilers merged commit 620d245 into datahub-project:master Jun 22, 2023
@joshuaeilers joshuaeilers deleted the je--retry-deleteEntityReferences branch June 22, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants