Return-Path: Delivered-To: apmail-hadoop-zookeeper-user-archive@locus.apache.org Received: (qmail 86143 invoked from network); 8 Dec 2008 19:49:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2008 19:49:03 -0000 Received: (qmail 56009 invoked by uid 500); 8 Dec 2008 19:49:15 -0000 Delivered-To: apmail-hadoop-zookeeper-user-archive@hadoop.apache.org Received: (qmail 55992 invoked by uid 500); 8 Dec 2008 19:49:15 -0000 Mailing-List: contact zookeeper-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-user@hadoop.apache.org Delivered-To: mailing list zookeeper-user@hadoop.apache.org Received: (qmail 55979 invoked by uid 99); 8 Dec 2008 19:49:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 11:49:15 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [69.147.107.21] (HELO mrout2-b.corp.re1.yahoo.com) (69.147.107.21) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 19:47:42 +0000 Received: from SNV-EXPF01.ds.corp.yahoo.com (snv-expf01.ds.corp.yahoo.com [207.126.227.250]) by mrout2-b.corp.re1.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id mB8Jm4Kh015603 for ; Mon, 8 Dec 2008 11:48:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=received:user-agent:date:subject:from:to:message-id: thread-topic:thread-index:in-reply-to:mime-version:content-type: content-transfer-encoding:return-path:x-originalarrivaltime; b=pn4s6QTgAKn4YZD3MRH3KhBKdJIjM0q92La/TZs6k/Et3zz5gbljgkCC8W3PelYW Received: from SNV-EXVS09.ds.corp.yahoo.com ([207.126.227.86]) by SNV-EXPF01.ds.corp.yahoo.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Dec 2008 11:48:03 -0800 Received: from 10.73.146.106 ([10.73.146.106]) by SNV-EXVS09.ds.corp.yahoo.com ([207.126.227.84]) via Exchange Front-End Server snv-webmail.corp.yahoo.com ([207.126.227.59]) with Microsoft Exchange Server HTTP-DAV ; Mon, 8 Dec 2008 19:48:03 +0000 User-Agent: Microsoft-Entourage/12.14.0.081024 Date: Mon, 08 Dec 2008 11:48:02 -0800 Subject: Re: NullPointerException stopping and starting Zookeeper servers From: Mahadev Konar To: Message-ID: Thread-Topic: NullPointerException stopping and starting Zookeeper servers Thread-Index: AclZbeEfk0pgPPjNk0CsgV5Dpq7Q9w== In-Reply-To: <493D7684.9050301@sun.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-OriginalArrivalTime: 08 Dec 2008 19:48:03.0860 (UTC) FILETIME=[E23B1540:01C9596D] X-Virus-Checked: Checked by ClamAV on apache.org Hi Thomas, This looks like a bug. Can you open a jira mentioning what the problem is and how to recreate it? Thanks mahadev On 12/8/08 11:33 AM, "Thomas Vinod Johnson" wrote: > Hi, > I have a replicated zookeeper services consisting of 3 zookeeper (3.0.1) > servers all running on the same host for testing purposes. I've created > exactly one znode in this ensemble. At this point, I stop, then restart > a single zookeeper server; moving onto the next one a few seconds later. > A few restarts later (about 4 is usually sufficient), I get the > following exception on one of the servers, at which point it exits: > java.lang.NullPointerException > at > org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTx > nLog.java:447) > at > org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.init(FileTx > nLog.java:358) > at > org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.(File > TxnLog.java:333) > at > org.apache.zookeeper.server.persistence.FileTxnLog.read(FileTxnLog.java:250) > at > org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog. > java:102) > at > org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:183) > at org.apache.zookeeper.server.quorum.Leader.lead(Leader.java:245) > at > org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:421) > 2008-12-08 14:14:24,880 - INFO > [QuorumPeer:/0:0:0:0:0:0:0:0:2183:Leader@336] - Shutdown called > java.lang.Exception: shutdown Leader! reason: Forcing shutdown > at > org.apache.zookeeper.server.quorum.Leader.shutdown(Leader.java:336) > at > org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:427) > Exception in thread "QuorumPeer:/0:0:0:0:0:0:0:0:2183" > java.lang.NullPointerException > at > org.apache.zookeeper.server.quorum.Leader.shutdown(Leader.java:339) > at > org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:427) > > The inputStream field is null, apparently because next is being called > at line 358 even after next returns false. Having very little knowledge > about the implementation, I don't know if the existence of hdr.getZxid() >> = zxid is supposed to be an invariant across all invocations of the > server; however the following change to FileTxnLog.java seems to make > the problem go away. > diff FileTxnLog.java /tmp/FileTxnLog.java > 358c358,359 > < next(); > --- >> if (!next()) >> return; > 447c448,450 > < inputStream.close(); > --- >> if (inputStream != null) { >> inputStream.close(); >> } > > Is this a bug? > > Thanks. >