-
Notifications
You must be signed in to change notification settings - Fork 840
Fix for Dialer.LookupPartition #191
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
Conversation
* Test against multiple Kafka versions * Message writer for record batches (#163) * Add branching for record batch writer * Make key and value from headers public * Add writeVarInt function * Implement writeRecord method * Write record batch method * Use zigzag encoding for varint * Drop logging * Add unit test for v2 record batch * Remove commented out code * Use int constants from math package * Use exact record size instead of extra buffer * Give a simpler name to calcVarIntLen * Move error check out of if else block * Extract message set size in a function * Give calcRecordSize a shorter name * Protect recordSize from confusing order of params * Use recordSize intead of estimatedRecordSize * Extract record batch size * Use record size from calculation * Assign offsets to messages in record batch * Write message set straight to output writer * Write record batch straight to output writer * Get rid of remainder buffer * Remove commented out code * Use bytes.Equal for comparing slices of bytes * Compress messages before calculating size * Run tests for kafka 0.10 (#187) Added a utility method to check broker version so that tests for newer functionality can be skipped. * fix
achille-roussel
left a comment
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.
Thanks for submitting this patch!
Would you be able to write a test to demonstrate that this change addresses the problem? (clearly we're missing this today).
|
Of course |
|
I was wrong, if you use If you set up a Kafka with an option |
|
@scarbo87 should we always return |
|
No, this is not a good solution. Currently I found two problems in the code.
I will take care of this. Let me know if you agree. |
|
@achille-roussel, this fix is more correct |
achille-roussel
left a comment
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.
Looking good, thanks for the fix! 👍
There is no break in forever loop, so we will never receive error “ UnknownTopicOrPartition” on line 181. My code fixes case when there is no partitions found.