Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 90435 invoked from network); 4 Aug 2009 06:01:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 06:01:16 -0000 Received: (qmail 9951 invoked by uid 500); 4 Aug 2009 06:01:21 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 9890 invoked by uid 500); 4 Aug 2009 06:01:20 -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 9880 invoked by uid 99); 4 Aug 2009 06:01:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 06:01:20 +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 angushe@gmail.com designates 74.125.92.26 as permitted sender) Received: from [74.125.92.26] (HELO qw-out-2122.google.com) (74.125.92.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 06:01:11 +0000 Received: by qw-out-2122.google.com with SMTP id 8so1844255qwh.35 for ; Mon, 03 Aug 2009 23:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=YpRSKMi9QwaoWHVQ5SMPe00vGlhLWW0d5uHjVoXHOks=; b=dI9yWIRIcjISPzgM1NIzG0rsMWXcqGoidI388BYN9Iz7hjYePATfIdpdSYAQ6AQYR+ KKJhgToZTUoMGxbKapOZ/jgpuWp9ZYfQ4i1cRGGG4p4HdbnkL1mVTSkPkwzRa5lyS1dp ritzWHm85KXEYuiyE1EuG2nxFo/iG/ijrwWVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=MtonRy5fxoJgazxM3mivJQJLrjPArJ7nPpi++CLBx5qST4c7b7Iq25dRbGN9n+Jwfa 1PoLGH2z2BXscZKMMnNGAUV/wf3zDqWEVr4Q73PM2nL1MifMrW/wOzLlP6zKidPlId3K tAc0SePhSw9m8f6zTmJPkePLkolxnmTQ07kzQ= MIME-Version: 1.0 Received: by 10.229.97.19 with SMTP id j19mr1608542qcn.54.1249365650941; Mon, 03 Aug 2009 23:00:50 -0700 (PDT) Date: Tue, 4 Aug 2009 14:00:50 +0800 Message-ID: <9b27a8a60908032300lf9fcfc2kd16c33c5388ee370@mail.gmail.com> Subject: HBase 0.20.0rc not close the connection to zookeeper explicitly when closing HTable (and HBaseAdmin) From: Angus He To: hbase-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi All, In HBase 0.20rc, HTable does not explicitly close the connection to zookeeper in HTable::close. It probably could be better. And in my opinion, it should be for: 1. It is not well-behaved, although zookeeper is able to detect the lost connection after issuing networking I/O operation, . 2. It is easy to get zookeeper server stuck with exceptions like "Too many connections from /0:0:0:0:0 :0:0:1 - max is 30", when user write codes like: for (int i = 0; i < 1024; ++i) { HTable table = new HTable("foobar"); table.close(); } In the current implementation, different HTable instances share the same connection to zookeeper if they have same HBaseConfiguration instance. For this, we cannot close the connection directly in HTable, but probably we could implement HConnection class with reference-counting ability. Any comments? -- Regards Angus