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

[HUDI-8811] Handle Kafka source configuration-related failures with specific exception handling #12569

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vamsikarnika
Copy link
Contributor

@vamsikarnika vamsikarnika commented Jan 3, 2025

Change Logs

Catch KafkaException instances and handle configuration-related errors by wrapping them in a HoodieSourceConfigException. Specifically, handle exceptions such as missing host or port, invalid or unresolved broker addresses, invalid host URLs.

Also in some cases missing required configs. For example when io.confluent.kafka.serializers.KafkaAvroDeserializer(default deserializer) is used as kafka deserializer and schema.registry.url config is missing in the provided configs, KafkaConsumer throws io.confluent.common.config.ConfigException during initialization. We're catching those exceptions and categorising them as HoodieSourceConfigExceptions here.

Impact

Add new exception type for HoodieSourceConfigException to catch issues specific to kafka configs

Risk level (write none, low medium or high below)

low

Documentation Update

NA

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Jan 3, 2025
@vamsikarnika vamsikarnika changed the title Add HoodieSourceConfigException for handling kafka source config errors [HUDI-8811] Categorize error of Kafka source timeout as customer-side issue and page customer to resolve Jan 3, 2025
@@ -75,6 +77,8 @@ protected InputBatch<T> readFromCheckpoint(Option<Checkpoint> lastCheckpoint, lo
lastCheckpoint, sourceLimit));
} catch (org.apache.kafka.common.errors.TimeoutException e) {
throw new HoodieSourceTimeoutException("Kafka Source timed out " + e.getMessage());
} catch (ConfigException ex) {
throw new HoodieSourceConfigException("kafka source config issue" + ex.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

For these errors, let's pass in the source exception so we can see the context.

Also what kind of errors will this catch? Adding the specifics to the PR description will be helpful for the reviewer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This catches errors related to kafka configs like invalid kafka host url, invalid port, unresolvable broker addresses(all provided brokers are unresolvable).

Also in some cases missing required configs. For example when io.confluent.kafka.serializers.KafkaAvroDeserializer is used as kafka deserializer and schema.registry.url config is missing in the provided configs, KafkaConsumer throws io.confluent.common.config.ConfigException during initialization. We're catching those exceptions and categorizing them as HoodieSourceConfigExceptions here.

@vamsikarnika vamsikarnika changed the title [HUDI-8811] Categorize error of Kafka source timeout as customer-side issue and page customer to resolve [HUDI-8811] Handle Kafka source configuration-related failures with specific exception handling Jan 3, 2025
@hudi-bot
Copy link

hudi-bot commented Jan 3, 2025

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S PR with lines of changes in (10, 100]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants