-
Notifications
You must be signed in to change notification settings - Fork 874
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
Can not subscribe to a topic with more than 1 partition when using Confluent.Kafka v2.2.0 in .NET Framework #2089
Comments
I confirm the presence of a problem in version 2.2.0 at .Net 7.0! When trying to subscribe to the topic "sample", the error 'Access violation' occurs: rd_tmpabuf_alloc0: rd_kafka_topic_info_new_with_rack:1860: requested size 16 + 7 > 20. My test:
|
same here; |
I have the exact same issue on .NET Framework. Tried it on versions 4.8, 4.7.2 and 4.6.2 and it crashes with an access violation. However, unlike posters above, I can't reproduce it in .NET 6.0 or 7.0. It is very strange and it seems it has something to do with the name of the topic you are subscribing to. 3 and 11 character topic names work fine while for instance a 6 character topic name will induce the crash. I'm hoping this will get looked into. EDIT: Also, for me at least, it is not affected by the number of partitions. |
I also had the same issue with .NET 4.8, the fix for me was to roll back confluent.kafka and librdkafka.redist to 2.2.1. Then I cleaned and re-built my project and it worked. This isn't an optimal fix but if you need to get your app going this should work. |
I tried reproducing with Dotnet SDK 6.0 and 7.0 on Ubuntu and Mac, but couldn't reproduce it. Will try checking with Dotnet Framework 4.8 on Windows machine. |
Hello, is this happening on a 32bit architecture? Seems similar to this issue that we've fixed recently with this PR |
I also had no problem using this package with .NET 6 or 7 on Windows machine. The problem only exists in .NET Framework. |
No, I faced this issue on a 64bit architecture. |
Thanks, I was able to reproduce this on Windows with dotnet framework 4.8. I think above PR by @emasab should fix the issue. I'll test it once we have the librdkafka 2.3.0 release done and will confirm here. |
same issue on my side, all consumers migrated to v2.2.0 crashes when executing subscribe() in line : |
We have released 2.3.0. Can you test with that and confirm if the issue is there? |
Fixed on my side |
Fixed here too :) |
Thanks for confirming. |
Description
It seems there is a bug when using Confluent.Kafka v2.2.0 in .NET Framework projects. When I want to subscribe to a topic with more than 1 partition it always crashes at Subscribe() method. There is no problem in using this package with .NET Core and .NET 6 or 7 projects. Also when I downgraded the package to v2.1.1 the issue resolved. Here is the error in v2.2.0 in .NET Framework projects:
rd_tmpabuf_alloc0: rd_kafka_topic_info_new_with_rack:1860: requested size 16 + 5 > 20
How to reproduce
1 - run kafka on docker
2- Create a topic with more than one partition, for example 3 partitions:
kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3 --topic test
3- produce some message in this topic
4- write a simple console app in .NET Framework which tries to subscribe to this topic and consume messages
the app will crash at Subscribe()
here is my code for consumer:
`var config = new ConsumerConfig
{
BootstrapServers = "localhost:9092",
GroupId = "kafka-dotnet-getting-started",
AutoOffsetReset = AutoOffsetReset.Earliest
};
`
Checklist
Please provide the following information:
The text was updated successfully, but these errors were encountered: