-
Notifications
You must be signed in to change notification settings - Fork 627
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
Skip processing buffer after partial message detected #1051
Skip processing buffer after partial message detected #1051
Conversation
Could this be what is happening in #998 ? |
@aikar I think #998 is different. Here client emits fake empty messages, like
And after this it starts reading from 0 offset again. But the order of messages and offset sequence are correct. |
FYI I've tested this code change locally against a 2.0 broker and it resolves some issues reported in against this library (e.g. #1054) If we could get a release with this code fix that'd be great. |
+1 to that -- if this is what I think it is, this is a consumer-breaking bug for folks on 2.x. We were bitten by a similar issue in Sarama: IBM/sarama#1149 |
+1 to that. We have tested this code locally against 2.0 broker and it resolves issue we faced consuming empty messages in a loop! |
Why is kafka sending these messages now anyways? |
Possible red herring, but reading between the lines on the Sarama bug & KAFKA-7030, I think it might be KIP-283. From the KIP (emphasis mine):
If this is what's causing the partial messages, it seems like setting |
We are facing this bug too. Kindly release this fix as soon as possible. Thanks. |
Published as 3.0.0 |
Kafka server may add partial message to the end of the message set with, for example, the following data:
Instead of key/value the message is filled with 0 bits sequence. I couldn't find any special requirements on the format of the partial message, so maybe this is allowed behavior. But with such message from the server consumer continues decoding 0 bits, emits empty messages and the worst - it ends up with array of 0 offsets, e.g. [96510, 96511, 96512, 0, 0, 0, 0, 0], which leads to starting reading the next batch from 0 offset and gets into an infinite cycle.
(Took info about protocol from https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Messagesets and https://kafka.apache.org/documentation.html#impl_reads )