Skip to content
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

Fix IPv6 address case in server_list function #66

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Fix IPv6 address case in server_list function #66

merged 1 commit into from
Feb 9, 2021

Conversation

Anvil
Copy link
Contributor

@Anvil Anvil commented Dec 21, 2020

Description

When specifying an IPv6 address in faust.App as broker, faust passes to aiokafka an incorrectly-transformed value.

e.g:

When I write this:

faust.App('mob', broker=f'kafka://[1234:5678::9abc]')

yarl.URL constructor receives the strings as is, but the returned object .host attribute is 1234:5678::9abc. So, the server_list function in transport/drivers/aiokafka.py creates 1234:5678::9abc:9092, which, while not syntactically incorrect, is a different IPv6 address. Also, the port information is lost in the process.

I've checked the yarl module and there does not seem to be any attribute/method to retrieve the enclosed IPv6 address. This small change intend to fix this behavior, on faust side.

L156 is assumed as a "is it an IPv6 address" check. While it could be better, I found it's good enough for me. :)

@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #66 (400f686) into master (e239534) will decrease coverage by 0.02%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
- Coverage   64.03%   64.00%   -0.03%     
==========================================
  Files          99       99              
  Lines       10290    10296       +6     
  Branches     1157     1159       +2     
==========================================
+ Hits         6589     6590       +1     
- Misses       3547     3552       +5     
  Partials      154      154              
Impacted Files Coverage Δ
faust/transport/drivers/aiokafka.py 33.33% <14.28%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e239534...400f686. Read the comment docs.

@max-k
Copy link
Contributor

max-k commented Dec 22, 2020

@patkivikram could you approve this ?
Anvil is one of my teammates and we did this together.
Thank you very much.

@patkivikram patkivikram merged commit 05c0ff9 into faust-streaming:master Feb 9, 2021
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.

4 participants