NPE in RaftActor#onGetOnDemandRaftStats 54/18854/4
authorTom Pantelis <tpanteli@brocade.com>
Wed, 22 Apr 2015 06:09:15 +0000 (02:09 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 23 Apr 2015 11:22:59 +0000 (07:22 -0400)
I had a 3 node setup with 1 node down and when I tried to access the
shard info via JConsole I saw this exception :

java.lang.NullPointerException: null value in entry:
member-3-shard-car-config=null
        at
com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)[114:com.google.guava:18.0.0]
        at
com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:88)[114:com.google.guava:18.0.0]
        at
com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:294)[114:com.google.guava:18.0.0]
        at
org.opendaylight.controller.cluster.raft.RaftActor.onGetOnDemandRaftStats(RaftActor.java:247)[227:org.opendaylight.controller.sal-akka-raft:1.2.0.SNAPSHOT]

The peer address in the map for the down node was null which
ImmutableMap.copyOf doesn't like. I changed it to HashMap.

Change-Id: If9e0dfb3f7f213c11c99d98a5fd9c804c0876776
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>

No differences found