-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Single-thread SimpleProducer says "KafkaError: this should not happen - are you threading?" #674
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
Comments
SimpleProducer is deprecated. I'd highly recommend using the KafkaConsumer / KafkaProducer interfaces if you want to use kafka-python 1.1.1 . The error message here indicates that there is a corrupt internal connection receive buffer. This buffer holds bytes internally when reading from a socket if/when the full message has not been fully delivered. I have not seen this error get thrown in normal use, but that doesn't mean there's not a bug somewhere. As the message suggests, the most likely culprit is unsynchronized, concurrent access to the receive buffer. Looking at your code, I might also suggest that you not reuse the same client instance across all producers/consumers. This is one of the many flaws of the Simple* interfaces -- they suggest that reusing a single client is helpful (it is usually not). |
@dpkp Thank you! Well, that works on my local machine :), but breaks in Travis CI. And again works well, with kafka-python older than 1.x.x. |
@dpkp the same bug occur in kafkaconsumer, the raw error log in https://gist.github.com/modeyang/d8d0e871eda105f5cd8bb17543f04692 |
Closing as out of date. Feel free to open a new issue if a similar error occurs in the latest release. |
Patch Set 1: Some of the issues I'm concerned about: dpkp/kafka-python#674 dpkp/kafka-python#686 dpkp/kafka-python#579 dpkp/kafka-python#551 Patch-set: 1
The stack trace is
Kafka-python version 1.1.1, kafka version is 0.8.2.2. See the full log and source code here
The text was updated successfully, but these errors were encountered: