Code Review 7012768: InetAddress lookupTable leaks/deadlocks when using unsupported name service spi

Alan Bateman Alan.Bateman at oracle.com
Thu Jan 20 06:17:51 PST 2011


Chris Hegarty wrote:
> Michael, Alan,
>
> There is an issue in InetAddress.getAddressesFromNameService, whereby 
> if the nameservice provider throws an unchecked exception it leaves 
> the host being looked up in the lookupTable. This will cause any 
> further lookups of that host to block and wait forever.
>
> Once a host is added to the lookupTable, through 
> checkLookupTable(host), it should always be removed after the 
> attempted lookup (whether successful or not).
>
> http://cr.openjdk.java.net/~chegar/7012768/webrev.00/webrev/
>
> -Chris.
The changes to InetAddress look good to me.  I see the existing tests 
for this spi are in test/sun/net/InetAddress and maybe the tests should 
go there (I realize it might mean moving some existing tests but the 
benefit is that the tests for this sun.net spi are in one place).

-Alan.



More information about the net-dev mailing list