ignite icon indicating copy to clipboard operation
ignite copied to clipboard

NullPointerException in TcpDiscoverySpi with unresolved addresses

Open veita opened this issue 10 months ago • 2 comments

Ignite 2.17.0; Java 21.

org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#getEffectiveNodeAddresses doesn't check for null values where it should.

https://github.com/apache/ignite/blob/ignite-2.17/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java#L1301

    /**
     * Gets the {@code InetAddress}.
     *
     * @return the InetAddress or {@code null} if it is unresolved.
     */
    public final InetAddress getAddress() {
        return holder.getAddress();
    }

This can lead to NPE during grid startup. We encounter this exception after updating Ignite from 2.16.0 to 2.17.0.

ERROR 2025-02-17T10:17:11,388Z - org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi[tcp-disco-sock-reader-[cb7d6682 172.19.0.1:52755]-#9768%B88AEA822354783A22E7765675B3298D87F3DF5B%-#9886%B88AEA822354783A22E7765675B3298D87F3DF5B%]
Runtime error caught during grid runnable execution: Socket reader [id=9977, name=tcp-disco-sock-reader-[cb7d6682 172.19.0.1:52755]-#9768%B88AEA822354783A22E7765675B3298D87F3DF5B%-#9886%B88AEA822354783A22E7765675B3298D87F3DF5B%, nodeId=cb7d6682-7aec-4c0e-8db3-59d10b03417a]
java.lang.NullPointerException: null

veita avatar Feb 17 '25 10:02 veita

@veita , can you share more information about your configuration and attach more logs? May be you can tell, how to reproduce problem?

shishkovilja avatar May 19 '25 07:05 shishkovilja

@veita , can you share more information about your configuration and attach more logs? May be you can tell, how to reproduce problem?

Unfortunately I can not provide additional information. Our DevOps team somehow seems to have fixed this error back then. However, this is clearly a bug in Ignite since it does not check for the documented case that the return value could be null for unresolved addresses.

veita avatar May 24 '25 11:05 veita