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

Update Error consts and Error.Temporary() #372

Merged
merged 1 commit into from
Nov 1, 2019
Merged

Update Error consts and Error.Temporary() #372

merged 1 commit into from
Nov 1, 2019

Conversation

dtjm
Copy link
Contributor

@dtjm dtjm commented Nov 1, 2019

Main goal is to update the list of Temporary errors. My application dropped many messages when a Kafka broker was down due to a NotEnoughReplicas error, so I thought it would be good to update them all.

https://kafka.apache.org/protocol#protocol_error_codes specifies which errors are retriable.

Copy link
Contributor

@achille-roussel achille-roussel 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 contribution!

Could you explain how you determined whether an error was temporary or not? Looking at the documentation link you added I assumed it would be based on whether the error is marked as "Retriable", but it seems like some are missing then? (e.g. CORRUPT_MESSAGE).

@achille-roussel achille-roussel self-assigned this Nov 1, 2019
@dtjm
Copy link
Contributor Author

dtjm commented Nov 1, 2019

@achille-roussel yes I just included the errors marked as "Retriable" in the documentation.

For some reason CORRUPT_MESSAGE (2) is called InvalidMessage here:
https://github.com/segmentio/kafka-go/blob/master/error.go#L14

@achille-roussel
Copy link
Contributor

Got it, thanks for clarifying. Kafka must have changed the name of the error between versions, this code was written when 0.10 was the latest version.

@achille-roussel achille-roussel merged commit ae89ccc into segmentio:master Nov 1, 2019
@dtjm dtjm deleted the fix-errors branch November 1, 2019 19:20
@dtjm
Copy link
Contributor Author

dtjm commented Nov 1, 2019

thanks for the super-fast turnaround!

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