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

consumer: poll: ignore transient error #69

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Conversation

0xdiba
Copy link
Contributor

@0xdiba 0xdiba commented Sep 18, 2018

Treat Poll GroupCoordinator response error: Local: Broker transport failure errors as transient.
For more info check out: confluentinc/librdkafka#1987 (comment)

consumer.go Outdated
// isErrorTerminal is a utility function checking if the returned errors should be treated as transient.
// It will probably get replaced with a librdKafka provided function, informing on each error's severity
// https://github.com/edenhill/librdkafka/issues/1987#issuecomment-422008750
func isErrorTerminal(err rdkafka.Error) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about something simpler like IgnorableErr()? This way we keep a consistent wording (in commit, documentation & code).

The logic in the body will be easier to read too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I think the function is not needed. If we ever reuse the same piece of code in more spots, then we could convert it to a function. Just a comment above the relevant piece of code with the link to edenhill's answer should be sufficient.

consumer.go Outdated
default:
c.log.Printf("Unknown event type: %T", e)
}

return nil, nil
}

// isErrorTerminal is a utility function checking if the returned errors should be treated as transient.
Copy link
Contributor

Choose a reason for hiding this comment

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

You could reduce this to:

ignorableError returns true if err is an error that should be ignored. [...]

Treat `Poll GroupCoordinator response error: Local: Broker transport failure` errors as transient.
For more info check out: confluentinc/librdkafka#1987 (comment)
@0xdiba 0xdiba merged commit 7f63f6d into master Sep 19, 2018
@0xdiba 0xdiba deleted the ignore_transient_poll_err branch September 19, 2018 15:17
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.

None yet

2 participants