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)
commita6b5dd4a9f2b8d9353d262c2723fa97afaa38f8d
treedd6acebc6ed2664fba933cc529c631d63ec3b5ef
parentdfbfbf7abe18e6d6011cd33d4906f8a7e030ee84
NPE in RaftActor#onGetOnDemandRaftStats

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>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java