-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
bbaf27f
to
b6b1fab
Compare
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)
b6b1fab
to
9461ec7
Compare
Treat
Poll GroupCoordinator response error: Local: Broker transport failure
errors as transient.For more info check out: confluentinc/librdkafka#1987 (comment)