You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/12/19 17:51:58 UTC
[jira] [Commented] (GEODE-2215) NPE in ViewCreator thread setting
public keys into a NetView
[ https://issues.apache.org/jira/browse/GEODE-2215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761822#comment-15761822 ]
ASF subversion and git services commented on GEODE-2215:
--------------------------------------------------------
Commit 5dfce1bd6fe625042abf243dec60098a9394ef27 in geode's branch refs/heads/develop from [~bschuchardt]
[ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=5dfce1b ]
GEODE-2215 NPE in ViewCreator thread setting public keys into a NetView
NetView creates a ConcurrentHashmap to hold the public keys when it's
constructed but it had some methods that were replacing it with a
Hashmap. I made the field final and also added checks to avoid putting
a null key or value into the map.
> NPE in ViewCreator thread setting public keys into a NetView
> ------------------------------------------------------------
>
> Key: GEODE-2215
> URL: https://issues.apache.org/jira/browse/GEODE-2215
> Project: Geode
> Issue Type: Bug
> Components: membership
> Reporter: Bruce Schuchardt
> Assignee: Mark Bretl
>
> I saw an NPE in a ViewCreator thread and created this unit test to reproduce the problem:
> {code}
> public void testNullPublicKeysNotRetained() throws Exception {
> NetView view = new NetView(members.get(0), 2, new ArrayList<>(members));
> setFailureDetectionPorts(view);
> NetView newView = new NetView(view, 3);
> for (InternalDistributedMember member: view.getMembers()) {
> view.setPublicKey(member, null);
> }
> newView.setPublicKeys(view);
> for (InternalDistributedMember member: view.getMembers()){
> assertNull(newView.getPublicKey(member));
> assertNull(view.getPublicKey(member));
> }
> }
> {code}
> The problem seems to be that some Maps that NetView uses to hold these keys accept null values whlie others do not.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)