Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 44031 invoked from network); 9 Oct 2009 15:48:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Oct 2009 15:48:16 -0000 Received: (qmail 13661 invoked by uid 500); 9 Oct 2009 15:48:16 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 13594 invoked by uid 500); 9 Oct 2009 15:48:16 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 13582 invoked by uid 99); 9 Oct 2009 15:48:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2009 15:48:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jdcryans@gmail.com designates 209.85.220.222 as permitted sender) Received: from [209.85.220.222] (HELO mail-fx0-f222.google.com) (209.85.220.222) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2009 15:48:06 +0000 Received: by fxm22 with SMTP id 22so6644049fxm.36 for ; Fri, 09 Oct 2009 08:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=BT1cT0I94fjzM12YMyG3L/ZL4vgZM7gODAoTynkn5BE=; b=Hs1D4zNQA6o27/d0h5xZjQ/uhNfhHGLWWwTivOD0Rd9GJWYAYWJMohEX3EHH6QP8Oc qGlWLBjsY176LZV1C8QdDqzanH7N5B8KIz2IsbSToOuLtbwRmID8BpshNDCUDjSFm9Qk VdElB7PDA2u5+jzWLpoDco1kJALuggoXruRW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=be9bwuVz8eIJ8A5Kfr8zqIQFBTCLJ1SAm6JbVDwo2nW2iqTtoCZzL7cRRQugOGL0UR UyY9lyaMq1JRzYDVGf5HMcwaxf2OdRfD5ekyCSD2BIfJok+qVFnDEB9N/coHSGCxXEje 0GhLE2ECcvbCLTTHbLhATG7XVb8vHgY9sLVF0= MIME-Version: 1.0 Sender: jdcryans@gmail.com Received: by 10.223.4.144 with SMTP id 16mr955805far.36.1255103265770; Fri, 09 Oct 2009 08:47:45 -0700 (PDT) In-Reply-To: <20091009173553.5b0434aa@eleonore.codelutin.home> References: <20091009165308.798a5aac@eleonore.codelutin.home> <31a243e70910090807y2d82da64je089bf0101044818@mail.gmail.com> <20091009173553.5b0434aa@eleonore.codelutin.home> Date: Fri, 9 Oct 2009 11:47:45 -0400 X-Google-Sender-Auth: ea92fab2bc11a8fa Message-ID: <31a243e70910090847raa7956dp956eff23d699cf55@mail.gmail.com> Subject: Re: Test fail randomly From: Jean-Daniel Cryans To: hbase-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Julien, Is it the only test you are running? If so, you shouldn't have to close after each operation but only at the end of the test. Are you sure this is the official 0.20.0 release? J-D On Fri, Oct 9, 2009 at 11:35 AM, Julien Ruchaud wrote: > Hi, > > If hbase.zookeeper.property.maxClientCnxns increase to 300, the test > pass. So I test the second solution to close connection each put, get > and delete, the test pass too. How do you know when to close > connection ? each get, delete or put ? is it better to instanciate a > new HTable each time ? > > Thanks > > Julien Ruchaud > > Le Fri, 9 Oct 2009 11:07:55 -0400, > Jean-Daniel Cryans a =E9crit : > >> Julien, >> >> This is a Zookeeper error that can be related to the number of >> connections a ZK server can handle. To verify, set >> hbase.zookeeper.property.maxClientCnxns to something a lot bigger than >> the default 30 and restart HBase. >> >> This could happen because =A0you run a lot of unit tests sequentially >> without closing the connections. >> >> J-D >> >> On Fri, Oct 9, 2009 at 10:53 AM, Julien Ruchaud >> wrote: >> > Hi, >> > >> > I am a newbie on hbase. Currently I am testing hbase 0.20.0, but I >> > don't understand why my test don't run correctly sometimes : >> > >> > =A0 =A0public void testLoop() throws Exception { >> > =A0 =A0 =A0 =A0HTable hTable =3D new HTable(new HBaseConfiguration(), >> > Bytes.toBytes("Table")); byte[] rowId =3D Bytes.toBytes("Test"); >> > >> > =A0 =A0 =A0 =A0for (int j =3D 0; j < 10; j++) { >> > =A0 =A0 =A0 =A0 =A0 =A0Put put =3D new Put(rowId); >> > =A0 =A0 =A0 =A0 =A0 =A0put.add(Bytes.toBytes("data"), Bytes.toBytes("1= :" + j), >> > Bytes.toBytes(j)); hTable.put(put); >> > =A0 =A0 =A0 =A0} >> > >> > =A0 =A0 =A0 =A0for (int j =3D 0; j < 10; j++) { >> > =A0 =A0 =A0 =A0 =A0 =A0Get get =3D new Get(rowId); >> > =A0 =A0 =A0 =A0 =A0 =A0Result row =3D hTable.get(get); >> > =A0 =A0 =A0 =A0 =A0 =A0if(row.getValue(Bytes.toBytes("data"), >> > Bytes.toBytes("1:" + j)) =3D=3D null) { throw new Exception("Error 1")= ; >> > =A0 =A0 =A0 =A0 =A0 =A0} >> > =A0 =A0 =A0 =A0} >> > >> > =A0 =A0 =A0 =A0for (int j =3D 0; j < 10; j++) { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Delete delete =3D new Delete(rowId); >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hTable.delete(delete); >> > =A0 =A0 =A0 =A0} >> > >> > =A0 =A0 =A0 =A0for (int j =3D 0; j < 10; j++) { >> > =A0 =A0 =A0 =A0 =A0 =A0Put put =3D new Put(rowId); >> > =A0 =A0 =A0 =A0 =A0 =A0put.add(Bytes.toBytes("data"), Bytes.toBytes("2= :" + j), >> > Bytes.toBytes(j)); hTable.put(put); >> > =A0 =A0 =A0 =A0} >> > >> > =A0 =A0 =A0 =A0for (int j =3D 0; j < 10; j++) { >> > =A0 =A0 =A0 =A0 =A0 =A0Get get =3D new Get(rowId); >> > =A0 =A0 =A0 =A0 =A0 =A0Result row =3D hTable.get(get); >> > =A0 =A0 =A0 =A0 =A0 =A0if(row.getValue(Bytes.toBytes("data"), >> > Bytes.toBytes("2:" + j)) =3D=3D null) { throw new Exception("Error 2")= ; >> > =A0 =A0 =A0 =A0 =A0 =A0} >> > =A0 =A0 =A0 =A0} >> > =A0 =A0} >> > >> > In fact I have got exception "Error 2" with a exception in hbase >> > log : >> > >> > 2009-10-09 16:39:34,829 WARN >> > org.apache.zookeeper.server.NIOServerCnxn: Exception causing close >> > of session 0x124393fc5390046 due to java.io.IOException: Read error >> > 2009-10-09 16:39:34,829 DEBUG >> > org.apache.zookeeper.server.NIOServerCnxn: IOException stack trace >> > java.io.IOException: Read error at >> > org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:366) >> > at >> > org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.ja= va:220) >> > 2009-10-09 16:39:34,830 INFO >> > org.apache.zookeeper.server.NIOServerCnxn: closing >> > session:0x124393fc5390046 NIOServerCnxn: >> > java.nio.channels.SocketChannel[connected local=3D/127.0.0.1:2181 >> > remote=3D/127.0.0.1:48870] 2009-10-09 16:39:34,830 DEBUG >> > org.apache.zookeeper.server.NIOServerCnxn: ignoring exception >> > during input shutdown java.net.SocketException: Transport endpoint >> > is not connected at sun.nio.ch.SocketChannelImpl.shutdown(Native >> > Method) at >> > sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:640) >> > at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:360) >> > at >> > org.apache.zookeeper.server.NIOServerCnxn.close(NIOServerCnxn.java:841= ) >> > at >> > org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:492) >> > at >> > org.apache.zookeeper.server.NIOServerCnxn$Factory.run(NIOServerCnxn.ja= va:220) >> > >> > Thanks in advance for your input >> > >> > Julien Ruchaud >> > >