Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4460C200C7C for ; Mon, 22 May 2017 07:28:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 42F60160BCF; Mon, 22 May 2017 05:28:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 86AC5160BC5 for ; Mon, 22 May 2017 07:28:17 +0200 (CEST) Received: (qmail 87267 invoked by uid 500); 22 May 2017 05:28:16 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 87256 invoked by uid 99); 22 May 2017 05:28:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 May 2017 05:28:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0B5A8190D4E for ; Mon, 22 May 2017 05:28:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id K3RBH5oyj7Jz for ; Mon, 22 May 2017 05:28:15 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C88BB5F3A1 for ; Mon, 22 May 2017 05:28:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v4M5SEb5027114; Mon, 22 May 2017 05:28:14 GMT Message-Id: <201705220528.v4M5SEb5027114@ip-10-146-233-104.ec2.internal> Date: Mon, 22 May 2017 05:28:13 +0000 From: "David Knupp (Code Review)" To: Sailesh Mukil , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Henry Robinson , Alex Behm , Matthew Jacobs , Dan Hecht Reply-To: dknupp@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5331=3A_Use_new_libHDFS_API_to_address_=22Unknown_Error_255=22=0A?= X-Gerrit-Change-Id: I181e316ed63b70b94d4f7a7557d398a931bb171d X-Gerrit-ChangeURL: X-Gerrit-Commit: 3c7183477bf7a53c6ecc12705beb3971e451cc6c In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 archived-at: Mon, 22 May 2017 05:28:18 -0000 David Knupp has posted comments on this change. Change subject: IMPALA-5331: Use new libHDFS API to address "Unknown Error 255" ...................................................................... Patch Set 6: (2 comments) http://gerrit.cloudera.org:8080/#/c/6894/6/tests/data_errors/test_data_errors.py File tests/data_errors/test_data_errors.py: Line 78: try: I wonder about stacking all of these asserts in one block. If any of them fails, the test will obviously fail, but not before trying to "leave" safe mode in the finally: clause. Is that the right thing to do in every situation? (E.g., maybe it makes more sense to leave the state as-is for triage? I don't know, I'm just asking.) Also, presumably the hdfs commands could fail in multiple ways. The first check to "get" the safemode, for example -- either the hdfs command succeeds but safe mode is "ON", or the command itself fails for some other reason. To differentiate the behavior and provide better assistance for someone triaging test failures, you might consider examining stderr as well, using something like: proc = subprocess.Popen(['hdfs', 'dfsadmin', '-safemode', 'get'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) output, error = proc.communicate() If "output" contains "Safe mode is ON" and "error" is an empty string, you know the command succeeded, but the expected state is incorrect. If the reverse is true, and "error" contains the meaningful string, then the command itself has failed. Perhaps you want to take different actions in each case. In the unlikely case that "hdfs" is not a valid command, an OSError will be raised. So maybe that's a third failure mode. Line 97: assert "Safe mode is OFF" in subprocess.Popen( If this is the happy path, this is fine. If the assert fails though, you might want to add a warning for the user that their safemode setting might be incorrect -- e.g., assert , "Command failed: system may still be in safemode" ... or something like that? -- To view, visit http://gerrit.cloudera.org:8080/6894 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I181e316ed63b70b94d4f7a7557d398a931bb171d Gerrit-PatchSet: 6 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Sailesh Mukil Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Dan Hecht Gerrit-Reviewer: David Knupp Gerrit-Reviewer: Henry Robinson Gerrit-Reviewer: Matthew Jacobs Gerrit-Reviewer: Sailesh Mukil Gerrit-HasComments: Yes