[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8313997: The jdi/ListeningConnector/startListening/startlis001 may fail if the hosts file
From:       Alex Menkov <amenkov () openjdk ! org>
Date:       2023-09-28 21:28:31
Message-ID: p8AGdOTDPtJNi7OGPhFSySGPFc71f0ufIAWQ5NPmRCk=.5d322a14-8454-46c3-9c45-7674f79672ca () github ! com
[Download RAW message or body]

On Wed, 9 Aug 2023 07:46:58 GMT, Sergey Bylokhov <serb@openjdk.org> wrote:

> The test uses this code to create a list of valid addresses for the localhost:
> 
> String hostname = "localhost";
> List<String> validAddresses = new LinkedList<>();
> validAddresses.add(hostname);
> Arrays.stream(InetAddress.getAllByName(hostname))
> .forEach(address -> validAddresses.add(address.getHostAddress()));
> 
> It does not work properly if the custom name is set for the 127.0.01 via /etc/hosts \
> file. In that case, the address returned by the "startListen()" will be \
> "SomeCustomName:port", for example we can return it here: \
> https://github.com/openjdk/jdk/blob/360f65d7b15b327e2f160c42f318945cc6548bda/src/jdk.jdi/share/classes/com/sun/tools/jdi/SocketTransportService.java#L82
> 

test/hotspot/jtreg/vmTestbase/nsk/jdi/ListeningConnector/startListening/startlis001.java \
line 109:

> 107:         makeValidAddresses("localhost", validAddresses);
> 108:         try {
> 109:             makeValidAddresses(InetAddress.getLocalHost().getHostName(),

Please add a comment describing why we need to add additional addresses for \
InetAddress.getLocalHost().getHostName()

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15203#discussion_r1340683631


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic