-
Notifications
You must be signed in to change notification settings - Fork 398
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
Async commit does not work #132
Conversation
Ok, i figured the local env stuff ( I needed to install the submodule). And thus I've managed to write a proper test case for the issue. The unfortunate circumstance here is that |
Does the synchronous commit work in your test? They both use the same method under the hood, so I would imagine it doesn't. |
@webmakersteve no it does not, i just pushed one more commit with that test too |
I think I remember this issue. Can you do this:
Then try to commit it? |
ha! it indeed worked with The |
This was a bug I discussed a while back with @InfinitiesLoop. I am trying to replicate the functionality of the I need to add a separate method to distinguish between these two types of commits. Will add |
@webmakersteve just saw #133, how confident are you that adding one to the message offset will have the expected outcome? Are we taking into consideration the messages that might be in-flight? I've fetched offsets 1, 2, 3. Message offset 1 has finished, 2 is still processing, i don't want to commit |
I'm adding this to the conversation as well, it looks like very similar to this case IBM/sarama#705 |
It does seem counterintuitive, but it's really how it works. You commit the offset that is the next message you want to read, not the offset of the last message you processed. Librdkafka abstracts that fact, adding 1 to the committed offset when you commit a message. But it also has a method to commit an offset directly, which does not add 1. We are using that one, causing ambiguity with which the client intended. Adding a commitMessage or the like will address that. We should be sure and heavily document the difference. |
Fixed with #133. Will update documentation in upcoming commit. |
I would definitely not be against having the additional tests in the test suite. If you're okay rebasing your changes and updating this commit, you can submit it as a separate PR, or re-open this one and I'll merge it in. |
PR Continues on #137 |
|
I've experimented with manual committing and found that when using the async commit pattern of including the message and a callback the commit is simply never registered by kafka.
I've tested this against kafka 9.x, I could not setup a local dev environment for node-rdkafka as it failed on
npm install
with:I'll see how this test case goes on CI and act accordingly, any tips to setup local dev env welcome