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

Differentiate between client and server version of ErrMessageSizeTooLarge #543

Closed
wvanbergen opened this issue Sep 26, 2015 · 5 comments
Closed

Comments

@wvanbergen
Copy link
Contributor

Right now, the Kafka broker can return ErrMessageSizeTooLarge if a message is deemed to large based on the broker configuration, but we also return it client-side in the producer based on the sarama configuration: https://github.com/Shopify/sarama/blob/53f2a54a5cfd662728648b20eb26e4a8e19b4887/async_producer.go#L255

For debugging purposes, it would be nice to be able to differentiate between the client and server-side version.

cc @andremedeiros @kvs @eapache

@wvanbergen wvanbergen changed the title Differentiate between client and server version ErrMessageSizeTooLarge Differentiate between client and server version of ErrMessageSizeTooLarge Sep 26, 2015
@wvanbergen
Copy link
Contributor Author

This case is a bit more confusing because it is determined by two configuration settings that live in different places that could be different from each other. This made debugging this error a lot harder.

Many of the other cases where we do this are not really influenced by different configuration settings, and we return what the broker would return anyway based on our best locally cached knowledge. I am not against a generic solution, but we jumped in the rabbit hole of adding context to these errors before without much luck.

Note: we also have ErrMessageTooLarge: https://github.com/Shopify/sarama/blob/master/errors.go#L37-L38

@eapache
Copy link
Contributor

eapache commented Sep 27, 2015

Ah you're right, that's legitimately confusing. Especially when you throw the consumer version of the error into the mix.

@AusIV
Copy link

AusIV commented Jan 13, 2020

I don't know that I have much more to add than a "me too", but I lost some critical time because this error is outright misleading. The error message:

kafka server: Message was too large, server rejected it to avoid allocation error.

It didn't even occur to me to look at the producer limits when the message specifically says the error was rejected by the server, and I knew the server limits were higher than the messages I was sending.

@dnwe dnwe added the stale/exempt Issues and pull requests that should never be closed as stale label Apr 7, 2020
@dnwe
Copy link
Collaborator

dnwe commented Aug 31, 2023

Fixed by #2628 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants