Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D5293200C08 for ; Thu, 26 Jan 2017 21:48:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D3A39160B4C; Thu, 26 Jan 2017 20:48:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 284DC160B31 for ; Thu, 26 Jan 2017 21:48:30 +0100 (CET) Received: (qmail 77736 invoked by uid 500); 26 Jan 2017 20:48:29 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 77725 invoked by uid 99); 26 Jan 2017 20:48:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2017 20:48:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B6546C2AA4 for ; Thu, 26 Jan 2017 20:48:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id cnJeSGRyMdcE for ; Thu, 26 Jan 2017 20:48:27 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 0F9005F644 for ; Thu, 26 Jan 2017 20:48:27 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4925CE044C for ; Thu, 26 Jan 2017 20:48:25 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8A4FE25297 for ; Thu, 26 Jan 2017 20:48:24 +0000 (UTC) Date: Thu, 26 Jan 2017 20:48:24 +0000 (UTC) From: "Mohammad Arshad (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2464) NullPointerException on ContainerManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 26 Jan 2017 20:48:31 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15840421#comment-15840421 ] Mohammad Arshad commented on ZOOKEEPER-2464: -------------------------------------------- Root cause of the problem is the inconsistent behavior of DataNode.getChildren() API. DataNode.getChildren() API Current Behaviour: # returns null initially When DataNode is created and no children are added yet, DataNode.getChildren() returns null # returns empty set after all the children are deleted: created a Node add a child delete the child DataNode.getChildren() returns empty set. I think we should fix this issue by modifying the DataNode.getChildren() API. We should always return empty set if there is no child. > NullPointerException on ContainerManager > ---------------------------------------- > > Key: ZOOKEEPER-2464 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2464 > Project: ZooKeeper > Issue Type: Bug > Components: server > Affects Versions: 3.5.1 > Reporter: Stefano Salmaso > Assignee: Jordan Zimmerman > Fix For: 3.5.3, 3.6.0 > > Attachments: ContainerManagerTest.java, ZOOKEEPER-2464.patch > > > I would like to expose you to a problem that we are experiencing. > We are using a cluster of 7 zookeeper and we use them to implement a distributed lock using Curator (http://curator.apache.org/curator-recipes/shared-reentrant-lock.html) > So .. we tried to play with the servers to see if everything worked properly and we stopped and start servers to see that the system worked well > (like stop 03, stop 05, stop 06, start 05, start 06, start 03) > We saw a strange behavior. > The number of znodes grew up without stopping (normally we had 4000 or 5000, we got to 60,000 and then we stopped our application) > In zookeeeper logs I saw this (on leader only, one every minute) > 2016-07-04 14:53:50,302 [myid:7] - ERROR [ContainerManagerTask:ContainerManager$1@84] - Error checking containers > java.lang.NullPointerException > at org.apache.zookeeper.server.ContainerManager.getCandidates(ContainerManager.java:151) > at org.apache.zookeeper.server.ContainerManager.checkContainers(ContainerManager.java:111) > at org.apache.zookeeper.server.ContainerManager$1.run(ContainerManager.java:78) > at java.util.TimerThread.mainLoop(Timer.java:555) > at java.util.TimerThread.run(Timer.java:505) > We have not yet deleted the data ... so the problem can be reproduced on our servers -- This message was sent by Atlassian JIRA (v6.3.4#6332)