Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change fixture default host to localhost #1305

Merged
merged 1 commit into from
Dec 5, 2017

Conversation

asdaraujo
Copy link
Contributor

@dpkp, I think the current errors with the Travis build may be because the VM have IPv6 disabled and since the fixtures are forcing the use of IPv6 the Kafka broker cannot bind to a valid address. If this is indeed the case, however, I'm not sure what happened recently that caused builds start failing.

I had a look at the KafkaFixture code and saw the comment saying that if the broker binds to an IPv4 address, then "kafka-python will attempt to connect on ::1 and fail".
I'm not sure why that's the case. I checked the code and couldn't find an explanation. Maybe this has been changed since?

I'm also not quite sure what's the use of the bracket notation for the broker address (e.g. [::1]). I couldn't find a reference to it in the Kafka documentation. I noticed that it doesn't work with "localhost". If I set the default address to [localhost] the tests fail. However, if the address is set to simply localhost it seems to work fine on hosts with IPv6 enabled or disabled.

I tested this change on two different VMs: one with IPv6 enabled and the other with IPv6 disabled. All tests passed. So I'm sending this PR to see how it goes on Travis.

@asdaraujo asdaraujo closed this Nov 20, 2017
@asdaraujo asdaraujo reopened this Nov 20, 2017
@jeffwidman jeffwidman requested a review from dpkp November 27, 2017 20:46
@dpkp
Copy link
Owner

dpkp commented Dec 5, 2017

Thanks for the fix! I don't recall the context behind the fixture change to require IPv6. This works on travis in all test configurations and I verified it works for me locally as well. Awesome!

@dpkp dpkp merged commit 141b6b2 into dpkp:master Dec 5, 2017
88manpreet added a commit to Yelp/kafka-python that referenced this pull request Dec 15, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants