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

nsqadmin: fix nodes list links with ipv6 addresses #1186

Merged
merged 3 commits into from
Sep 17, 2019

Conversation

ploxiln
Copy link
Member

@ploxiln ploxiln commented Sep 11, 2019

alternative to #1179

@andyxning please try this. I've clicked around and all links seem to work. (be sure to do a full refresh of nsqadmin, if you have the web page generated from a previous version already open in a tab.)

test setup:

  • ./build/nsqlookupd
  • ./build/nsqd --broadcast-address=::1 --lookupd-tcp-address=[::1]:4160
  • curl localhost:4151/pub?topic=whatever -d '{"foo": 20}' ; echo
  • ./build/nsq_tail --lookupd-http-address=[::1]:4161 --topic=whatever --channel=t3
  • ./build/nsqadmin --lookupd-http-address=[::1]:4161

cc @jehiah

An ipv6 address needs to be wrapped in "[]" when joined with port
because ":" inside the ipv6 address makes it ambiguous.

Most (all?) of our go code uses net.JoinHostPort() which does this.
@ploxiln
Copy link
Member Author

ploxiln commented Sep 11, 2019

note that the topic and channel pages do this, and it results in the correct links:

        {{#each nodes}}
        <tr>
            <td>
                <button class="btn-link red tombstone-link" data-node="{{node}}" data-topic="{{../name}}" style="padding: 0 6px; border: 0;">✘</button>
                {{#if show_broadcast_address}}
                {{hostname_port}} (<a class="link" href="{{basePath "/nodes"}}/{{node}}">{{node}}</a>)
                {{else}}
                <a class="link" href="{{basePath "/nodes"}}/{{node}}">{{hostname_port}}</a>
                {{/if}}

@andyxning
Copy link
Member

andyxning commented Sep 16, 2019

@ploxiln I have tested this locally. But it can not be operated successfully.

1
2

Have you tested this PR against non localhost ipv6 address?

Commands:

./nsqd -broadcast-address=fdbd:dc02:8:92::85 -lookupd-tcp-address=[fdbd:dc02:8:92::85]:4260
./nsqlookupd -broadcast-address=fdbd:dc02:8:92::85 -http-address=[fdbd:dc02:8:92::85]:4261 -tcp-address=[fdbd:dc02:8:92::85]:4260
./nsqadmin -http-address=[fdbd:dc02:8:92::85]:4271 -lookupd-http-address=[fdbd:dc02:8:92::85]:4261

@andyxning
Copy link
Member

andyxning commented Sep 16, 2019

@ploxiln I have investigated this further. It turns out that something has changed after v0.3.8, which we use internally. I have tested your changes against master branch, it is ok. And i think we can merge this. :)

As for our cases, we need to just merge #1179 internally since it is based on v0.3.8. :) I will close #1179.

@andyxning
Copy link
Member

/lgtm

@ploxiln
Copy link
Member Author

ploxiln commented Sep 16, 2019

It turns out that something has changed after v0.3.8, which we use internally.

That explains the confusion :)
Thank you for identifying the problem and testing this!

@andyxning
Copy link
Member

I think we can merge this for now. But i have no merge right.

BTW, what about the request about promoting myself to be a NSQ member?

@ploxiln
Copy link
Member Author

ploxiln commented Sep 17, 2019

yeah, was just giving some more comment time before merge :)

It turns out I actually don't have sufficient privileges to add other members to the organization, I will ping some people about that.

@ploxiln ploxiln merged commit 9faeb4a into nsqio:master Sep 17, 2019
@andyxning
Copy link
Member

It turns out I actually don't have sufficient privileges to add other members to the organization, I will ping some people about that.

Thanks for your help @ploxiln . Any more details we can chat on email. :)

@ploxiln ploxiln deleted the ipv6_nodes_link_fix branch December 16, 2019 17:06
@mreiferson mreiferson added the bug label Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants