Hazelcast plugin NPE exception

hi,we use openfire version 4.4.2 and hazelcast version 2.4.2 that clustered with 3 node
when user create multi session this error occurred and BOT (a plugin) reply message not routed to client

2019.10.02 20:54:08 org.jivesoftware.openfire.spi.RoutingTableImpl - Primary packet routing failed
java.lang.NullPointerException: null
at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToLocalDomain(RoutingTableImpl.java:343) ~[xmppserver-4.4.2.jar:4.4.2]
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:239) [xmppserver-4.4.2.jar:4.4.2]
at org.jivesoftware.openfire.plugin.util.cluster.RemotePacketExecution.run(RemotePacketExecution.java:60) [hazelcast-2.4.2.jar:?]
at org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory$CallableTask.call(ClusteredCacheFactory.java:557) [hazelcast-2.4.2.jar:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at com.hazelcast.executor.impl.DistributedExecutorService$CallableProcessor.run(DistributedExecutorService.java:270) [hazelcast-3.12.jar:3.12]
at com.hazelcast.util.executor.CachedExecutorServiceDelegate$Worker.run(CachedExecutorServiceDelegate.java:227) [hazelcast-3.12.jar:3.12]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64) [hazelcast-3.12.jar:3.12]
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80) [hazelcast-3.12.jar:3.12]

Looks to me like a race condition in RoutingTableImpl. I’ve raised https://issues.igniterealtime.org/browse/OF-1888 to cover it off.

From my (brief) analysis, this would only occur rarely - is this right?

Greg

when user have two or more session in cluster mode often occured

in cluster mode localRoutingTable.getRoute(route) result for remote session is null

1 Like

Description of class LocalRoutingTable says:

“Internal component used by the RoutingTable to keep references to routes hosted by this JVM. When running in a cluster each cluster member will have its own RoutingTable containing an instance of this class. Each LocalRoutingTable is responsible for storing routes to components, client sessions and outgoing server sessions hosted by local cluster node…”

So because remote routes are not synched over the cluster members it will always be null?

I fix it by add check null