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

Reply via email to