Skip to content

Fix #257 - Allow KafkaConnection to work correctly with gevent. #258

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

Closed
wants to merge 1 commit into from

Conversation

manfre
Copy link

@manfre manfre commented Oct 24, 2014

KafkaConnection inherits from threading.local, which is patched by
gevent to ensure one connection per greenlet, instead of one per
thread. If threading.local patching is detected, the base class
will be changed to object.

KafkaConnection inherits from threading.local, which is patched by
gevent to ensure one connection per greenlet, instead of one per
thread. If threading.local patching is detected, the base class
will be changed to object.
@manfre
Copy link
Author

manfre commented Oct 24, 2014

Updated PR to fix author and use type(...) instead of super().new(...).

@manfre manfre closed this Oct 27, 2014
@wizzat
Copy link
Collaborator

wizzat commented Oct 27, 2014

Why close?

@manfre
Copy link
Author

manfre commented Oct 27, 2014

Found a potential greenlet issue where the connection can get in to a bad state. I'm still investigating and figured it was safer to close while I troubleshoot. I'm also not sure whether I'm really happy with having a single connection to kafka for all of the greenlets.

@wizzat
Copy link
Collaborator

wizzat commented Oct 27, 2014

Hmmm. One thing to be careful of is that the underlying kafka-python library doesn't currently handle multiplexing requests across a single connection. That might cause some serious problems if you don't keep to the current model of fully synchronous connection state (the connection is effectively blocked between calls).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants