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

inspector: print all listening addresses #26008

Closed
wants to merge 1 commit into from

Conversation

@bnoordhuis
Copy link
Member

commented Feb 8, 2019

Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

Fixes: #13772

CI: https://ci.nodejs.org/job/node-test-pull-request/20671/ - test failures possible, some tests probably assume the current output. Everything passes for me locally though.

inspector: print all listening addresses
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

Fixes: #13772
@cjihrig
cjihrig approved these changes Feb 8, 2019
@refack

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

Locally:

D:\code\4node\gyp>d:\refael\Downloads\node.exe --inspect=localhost:0
Debugger listening on ws://localhost:56121/d4d038da-ff6a-4e0b-ac0c-d5cad82c928a
Debugger listening on ws://localhost:56122/d4d038da-ff6a-4e0b-ac0c-d5cad82c928a
For help, see: https://nodejs.org/en/docs/inspector
@refack
refack approved these changes Feb 8, 2019
Copy link
Member

left a comment

test failures possible, some tests probably assume the current output. Everything passes for me locally though.

Since nothing failed, we probably should have a test for this.

@bnoordhuis

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2019

we probably should have a test for this

Yes, but how? CI machines may or may not be multi-homed, kind of difficult to test for.

I could write a test that checks with dns.lookup() if a hostname (and: what hostname?) resolves to more than one address but it would be dead code if no CI machine is actually multi-homed.

@bnoordhuis

This comment has been minimized.

Copy link
Member Author

commented Feb 9, 2019

The one failure seems to be infrastructural?

08:50:58 + docker exec node-ci-jessie /bin/sh -c 'cd /home/iojs/build/workspace/node-test-binary-arm && . /home/iojs/build/workspace/node-test-binary-arm/node-ci-exec'
08:51:00 OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "process_linux.go:90: adding pid 26098 to cgroups caused \"failed to write 26098 to cgroup.procs: write /sys/fs/cgroup/cpu,cpuacct/docker/a4e4fbb3c89a89856f299285777bc58d01f4a0275208f0ff49a4db562fadbf55/cgroup.procs: invalid argument\"": unknown
@refack

This comment has been minimized.

Copy link
Member

commented Feb 10, 2019

I could write a test that checks with dns.lookup() if a hostname (and: what hostname?) resolves to more than one address but it would be dead code if no CI machine is actually multi-homed.

I think that if a machine is both IPv4 & IPv6 enabled in will assign two ports (well at least for windows it will)... And we have those predicates in test/common. Worth a shot.

@bnoordhuis

This comment has been minimized.

Copy link
Member Author

commented Feb 10, 2019

I think that if a machine is both IPv4 & IPv6 enabled in will assign two ports (well at least for windows it will)

If you're 100% positive it works that way for Windows I could write that test.

On Unices, localhost is only going to be mapped to two addresses when it has two entries in /etc/hosts but that's uncommon. Most distros call it something like ip6-localhost.

@eugeneo
Copy link
Contributor

left a comment

I just want to point out that this was not implemented originally because of concerns that some clients parsing the output might be broken due to unexpected second and such message. I strongly believe such clients should be fixed :)

@addaleax

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

@addaleax

This comment has been minimized.

@addaleax

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

@BridgeAR

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

Landed in df67cd0 🎉

@BridgeAR BridgeAR closed this Mar 4, 2019

BridgeAR added a commit to BridgeAR/node that referenced this pull request Mar 4, 2019
inspector: print all listening addresses
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

PR-URL: nodejs#26008
Fixes: nodejs#13772
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit that referenced this pull request Mar 4, 2019
inspector: print all listening addresses
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

PR-URL: #26008
Fixes: #13772
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR referenced this pull request Mar 4, 2019
BridgeAR added a commit that referenced this pull request Mar 5, 2019
inspector: print all listening addresses
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

PR-URL: #26008
Fixes: #13772
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs added a commit that referenced this pull request Apr 16, 2019
inspector: print all listening addresses
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.

No test. I can't think of a reliable way to test this on the CI matrix.

PR-URL: #26008
Fixes: #13772
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs referenced this pull request May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.