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

Producer fails faster, Retry publish after Auth error #1437

Merged
merged 13 commits into from
Jan 19, 2025

Conversation

erikvanoosten
Copy link
Collaborator

@erikvanoosten erikvanoosten commented Jan 14, 2025

  1. When the producer fails to send a message in a batch of messages, it stops sending after the first error. This behavior is extended by also stopping after a failure from Kafka's callback.

  2. Introduce producer setting authErrorRetrySchedule on which sending after auth errors (AuthorizationException and AuthenticationException) can be retried. Auth error occur on some slow brokers. Note that this feature is disabled by default because it re-orders sent messages.
    This is a follow-up of Allow for some auth exceptions during poll #1270 where we retry polling after an auth error.

Both changes have been made possible by a new test framework in which we have precise control over the order of callbacks.

This change is not binary compatible due to changes in ProducerSettings.

Also:

  • cleanup Producer scaladocs
  • add more producer tests

Introduce a `authErrorRetrySchedule` on which publishing after auth errors (`AuthorizationException` and `AuthenticationException`) can be retried. Auth error occur on some slow brokers.

This change is not binary compatible due to changes in `ProducerSettings`.

TODO: unit test
@erikvanoosten erikvanoosten force-pushed the auth-error-retry-produce branch from 13fdaa1 to 2f1d122 Compare January 18, 2025 17:36
@erikvanoosten erikvanoosten marked this pull request as ready for review January 18, 2025 17:36
@erikvanoosten erikvanoosten changed the title Retry publish after Auth error Producer fails faster, Retry publish after Auth error Jan 19, 2025
Copy link
Collaborator

@svroonland svroonland left a comment

Choose a reason for hiding this comment

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

Nice!

@erikvanoosten erikvanoosten merged commit 645591b into master Jan 19, 2025
13 checks passed
@erikvanoosten erikvanoosten deleted the auth-error-retry-produce branch January 19, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants