-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
remove unnecessary encoding/decoding also fix ipv6 issue #2857
remove unnecessary encoding/decoding also fix ipv6 issue #2857
Conversation
/hold |
Codecov Report
@@ Coverage Diff @@
## master #2857 +/- ##
=======================================
Coverage 47.57% 47.57%
=======================================
Files 77 77
Lines 5532 5532
=======================================
Hits 2632 2632
Misses 2560 2560
Partials 340 340 Continue to review full report at Codecov.
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, ElvinEfendi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
What this PR does / why we need it:
Currently we concat address and port using
:
and thebalance
interface takes care of splitting. But when the IP address is i.e::1
then this breaks the whole thing. After encoding it becomes something like::1:8080
where8080
is a port. And when you decode it you getip = nil
,port = ":1:8080"
. The PR changes this unnecessary encoding/decoding first. But even that is not enough for supporting IPv6 endpoints because with that change we would be doing something likebalancer.set_current_upstream("::1:8080")
, and this is incorrect because when given with port, IPv6 addresses must be wrapped in square brackets. This is why the PR also introduces a preprocessing step insync_backend
where the helper function rewrites every IPv6 address into[IPv6]
.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #2930Special notes for your reviewer: