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

KAFKA-16448: Add ProcessingExceptionHandler in Streams configuration #16092

Conversation

loicgreffier
Copy link
Contributor

@loicgreffier loicgreffier commented May 27, 2024

This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Jira: https://issues.apache.org/jira/browse/KAFKA-16448.

Contributors

@Dabz
@sebastienviale
@loicgreffier

Depends On

#16090

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

loicgreffier and others added 3 commits May 28, 2024 19:25
Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>
Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>
Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>
@gharris1727 gharris1727 added streams kip Requires or implements a KIP labels May 28, 2024
Copy link
Contributor

@cadonna cadonna left a comment

Choose a reason for hiding this comment

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

@loicgreffier Thanks for the PR!

Here my comment.

Since today is feature freeze, it would be great if you could make the changes as soon as possible.

Comment on lines +936 to +945
.define(PROCESSING_EXCEPTION_HANDLER_CLASS_CONFIG,
Type.CLASS,
LogAndFailProcessingExceptionHandler.class.getName(),
Importance.MEDIUM,
PROCESSING_EXCEPTION_HANDLER_CLASS_DOC)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add unit tests in StreamsConfigTest?
I think you need the following unit tests:

  • One where config is not set to verify the default value
  • One where the config is set and you get the correct instance from processingExceptionHandler().

Copy link
Contributor

Choose a reason for hiding this comment

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

hi,
It is done !

sebastienviale and others added 6 commits May 29, 2024 10:15
…fig' of https://github.com/loicgreffier/kafka into KAFKA-16448-Add-Processing-Exception-Handler-StreamsConfig
…fig' of https://github.com/loicgreffier/kafka into KAFKA-16448-Add-Processing-Exception-Handler-StreamsConfig

Co-authored-by: Dabz <[email protected]>
Co-authored-by: loicgreffier <[email protected]>
…fig' of https://github.com/loicgreffier/kafka into KAFKA-16448-Add-Processing-Exception-Handler-StreamsConfig
Copy link
Contributor

@cadonna cadonna left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, @loicgreffier and @sebastienviale!

After addressing my comment, I will approve and merge this PR.

@Test
public void testInvalidProcessingExceptionHandler() {
props.put(StreamsConfig.PROCESSING_EXCEPTION_HANDLER_CLASS_CONFIG, "org.apache.kafka.streams.errors.InvalidProcessingExceptionHandler");
assertThrows(ConfigException.class, () -> new StreamsConfig(props));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also verify the message?

Suggested change
assertThrows(ConfigException.class, () -> new StreamsConfig(props));
final Exception exception = assertThrows(ConfigException.class, () -> new StreamsConfig(props));
assertThat(
exception.getMessage(),
containsString("<the message to verify>")
);

Copy link
Contributor

Choose a reason for hiding this comment

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

Verification has been added

Copy link
Contributor

@cadonna cadonna left a comment

Choose a reason for hiding this comment

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

@loicgreffier loicgreffier force-pushed the KAFKA-16448-Add-Processing-Exception-Handler-StreamsConfig branch from 85060e6 to 60bba3b Compare May 29, 2024 17:24
@loicgreffier
Copy link
Contributor Author

@cadonna I've rebased this PR so file changes are now clear. Do we need to squash commits manually or is it automatically done when merging ?

sebastienviale and others added 2 commits May 29, 2024 21:49
…fig' of https://github.com/loicgreffier/kafka into KAFKA-16448-Add-Processing-Exception-Handler-StreamsConfig
Co-authored-by: Dabz <[email protected]>
Co-authored-by: loicgreffier <[email protected]>
@cadonna
Copy link
Contributor

cadonna commented May 30, 2024

@cadonna I've rebased this PR so file changes are now clear. Do we need to squash commits manually or is it automatically done when merging ?

Thanks! Squashing happens when merging. Don't worry!

@cadonna cadonna merged commit 3f70c46 into apache:trunk May 30, 2024
1 check failed
cadonna added a commit to cadonna/kafka that referenced this pull request May 30, 2024
cadonna added a commit that referenced this pull request May 30, 2024
chiacyu pushed a commit to chiacyu/kafka that referenced this pull request Jun 1, 2024
…pache#16092)

This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>

Reviewer: Bruno Cadonna <[email protected]>
chiacyu pushed a commit to chiacyu/kafka that referenced this pull request Jun 1, 2024
wernerdv pushed a commit to wernerdv/kafka that referenced this pull request Jun 3, 2024
…pache#16092)

This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>

Reviewer: Bruno Cadonna <[email protected]>
wernerdv pushed a commit to wernerdv/kafka that referenced this pull request Jun 3, 2024
TaiJuWu pushed a commit to TaiJuWu/kafka that referenced this pull request Jun 8, 2024
…pache#16092)

This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>

Reviewer: Bruno Cadonna <[email protected]>
TaiJuWu pushed a commit to TaiJuWu/kafka that referenced this pull request Jun 8, 2024
gongxuanzhang pushed a commit to gongxuanzhang/kafka that referenced this pull request Jun 12, 2024
…pache#16092)

This PR is part of KAFKA-16448 which aims to bring a ProcessingExceptionHandler to Kafka Streams in order to deal with exceptions that occur during processing.

This PR brings ProcessingExceptionHandler in Streams configuration.

Co-authored-by: Dabz <[email protected]>
Co-authored-by: sebastienviale <[email protected]>

Reviewer: Bruno Cadonna <[email protected]>
gongxuanzhang pushed a commit to gongxuanzhang/kafka that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kip Requires or implements a KIP streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants