Skip to content

Ensure that async producer works in windows. Fixes #46 #61

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

Merged
merged 2 commits into from
Oct 8, 2013

Conversation

mahendra
Copy link
Collaborator

@mahendra mahendra commented Oct 7, 2013

As per the multiprocessing module's documentation, the objects
passed to the Process() class must be pickle-able in Windows.
So, the Async producer did not work in windows.

To fix this we have to ensure that code which uses multiprocessing
has to follow certain rules

  • The target=func should not be a member function
  • We cannot pass objects like socket() to multiprocessing

This ticket fixes these issues. For KafkaClient and KafkaConnection
objects, we make copies of the object and reinit() them inside the
child processes.

As per the multiprocessing module's documentation, the objects
passed to the Process() class must be pickle-able in Windows.
So, the Async producer did not work in windows.

To fix this we have to ensure that code which uses multiprocessing
has to follow certain rules
* The target=func should not be a member function
* We cannot pass objects like socket() to multiprocessing

This ticket fixes these issues. For KafkaClient and KafkaConnection
objects, we make copies of the object and reinit() them inside the
child processes.
@mahendra
Copy link
Collaborator Author

mahendra commented Oct 7, 2013

This fixes #46

@mahendra mahendra mentioned this pull request Oct 7, 2013
@mahendra
Copy link
Collaborator Author

mahendra commented Oct 7, 2013

@watchforstock - please test code from this pull request, instead of my 'windows' branch

@watchforstock
Copy link

Looks to work in my environment - data being uploaded with async=True and appearing in the queue for other consumers

Conflicts:
	kafka/producer.py
mahendra added a commit that referenced this pull request Oct 8, 2013
Ensure that async producer works in windows. Fixes #46
@mahendra mahendra merged commit 92d70e7 into dpkp:master Oct 8, 2013
@mahendra mahendra deleted the prod-windows branch October 8, 2013 03:29
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