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

Fix consumer not restarting on retriable connection errors #1304

Merged
merged 4 commits into from
May 2, 2022

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Mar 7, 2022

In some situation, a KafkaJSNumberOfRetriesExceeded error can be the cause of a KafkaJSNonRetriableError. In that case, the consumer would not correctly determine whether or not it should restart or permanently crash.

So, to figure out if we should allow the consumer to restart, we now unwrap the error to get the retriability of the original error instead of just the top-level error.

Fixes #1299

This deprecates the old `originalError` property and
replaces it with `cause`. See https://tc39.es/proposal-error-cause/
KafkaJSNumberOfRetriesExceeded and KafkaJSNonRetriableError are
not retriable, but we still want to allow the user to restart the
consumer if the original error was retriable. Because we can have
a KafkaJSNumberOfRetriesExceeded error as the cause of a
KafkaJSNonRetriableError, we need to unwrap that to get the original
error.

Fixes #1299
@Nevon Nevon merged commit d86a8d1 into master May 2, 2022
@Nevon Nevon deleted the fix-retries-1299 branch May 2, 2022 13:02
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.

v1.16.0 KafkaJSNumberOfRetriesExceeded change bug/question
1 participant