Repository: incubator-impala Updated Branches: refs/heads/master c03d398da -> ba8c135ef
IMPALA-4684: Wrap checking for HBase nodes ina try/finally block If an exception (other than NoNodeError) was raised while checking for HBase nodes, we weren't cleanly stopping the ZooKeeper client, which in turn created a second exception when the the connection was closed. The second exception masked the original error condition. Tested by forcibly raising unexpected errors while checking for HBase nodes. Change-Id: I46a74d018f9169385a9f10a85718044c31a24dbc Reviewed-on: http://gerrit.cloudera.org:8080/5547 Reviewed-by: Tim Armstrong <[email protected]> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/73146a0a Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/73146a0a Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/73146a0a Branch: refs/heads/master Commit: 73146a0a46817660505fa37957d44d73f020bc65 Parents: c03d398 Author: David Knupp <[email protected]> Authored: Mon Dec 19 14:47:38 2016 -0800 Committer: Internal Jenkins <[email protected]> Committed: Wed Dec 21 00:22:16 2016 +0000 ---------------------------------------------------------------------- testdata/bin/check-hbase-nodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/73146a0a/testdata/bin/check-hbase-nodes.py ---------------------------------------------------------------------- diff --git a/testdata/bin/check-hbase-nodes.py b/testdata/bin/check-hbase-nodes.py index 999a657..28ac0c1 100755 --- a/testdata/bin/check-hbase-nodes.py +++ b/testdata/bin/check-hbase-nodes.py @@ -131,8 +131,10 @@ def check_znodes_list_for_errors(nodes, zookeeper_hosts, timeout): 0 success, or else the number of unresponsive nodes """ with closing(connect_to_zookeeper(zookeeper_hosts, timeout)) as zk_client: - errors = sum([check_znode(node, zk_client, timeout) for node in nodes]) - zk_client.stop() + try: + errors = sum([check_znode(node, zk_client, timeout) for node in nodes]) + finally: + zk_client.stop() return errors
