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 BA6A3200CF8 for ; Thu, 14 Sep 2017 22:18:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B9BCB1609CD; Thu, 14 Sep 2017 20:18: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 0B3281609C6 for ; Thu, 14 Sep 2017 22:18:17 +0200 (CEST) Received: (qmail 96545 invoked by uid 500); 14 Sep 2017 20:18: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 96533 invoked by uid 99); 14 Sep 2017 20:18:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2017 20:18:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7BCD0C3BF9 for ; Thu, 14 Sep 2017 20:18:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id sgk5RJTVYC2y for ; Thu, 14 Sep 2017 20:18:14 +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 B019D5F19D for ; Thu, 14 Sep 2017 20:18: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 v8EKIDiE015423; Thu, 14 Sep 2017 20:18:13 GMT Message-Id: <201709142018.v8EKIDiE015423@ip-10-146-233-104.ec2.internal> Date: Thu, 14 Sep 2017 20:18:13 +0000 From: "Tianyi Wang (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Thomas Tauber-Marshall Reply-To: twang@cloudera.com X-Gerrit-MessageType: newpatchset Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5416=3A_Fix_an_impala-shell_command_recursion_bug=0A?= X-Gerrit-Change-Id: I453af2d4694d47e184031cb07ecd2af259ba20f3 X-Gerrit-ChangeURL: X-Gerrit-Commit: cefc2d6d9daa03fc593b4eff9271d48b58ab5c7a 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: Thu, 14 Sep 2017 20:18:18 -0000 Tianyi Wang has uploaded a new patch set (#2). Change subject: IMPALA-5416: Fix an impala-shell command recursion bug ...................................................................... IMPALA-5416: Fix an impala-shell command recursion bug Impala-shell crashes with 2 source commands on the same line and runs a command multiple times if it shares the same line with a source command. The cause is that there is a "cmdqueue" member in cmd library, which is used to execute commands not directly from user input. When impala-shell reads a line with multiple commands, it splits the line into multiple queries and insert them into the queue, and then gives control back to the eventloop in cmd library. The problem is that a source command calls execute_query_list(), which executes queries in the cmdqueue as well. So any query in the cmdqueue will be executed twice. And if there is unfortunately a source command in the cmdqueue, it will call execute_query_list() again, and there will be an infinite recursion. The original purpose of running queued queries in execute_query_list() is that in non-interactive mode, there is no event loop. And still, there are queries like "use database" queued by connection setup procedures, which need to be run before the user query. This patch avoids running queries from the queue in execute_query_list(), and for non-interactive mode, runs queued queries in execute_queries_non_interactive_mode() instead. Change-Id: I453af2d4694d47e184031cb07ecd2af259ba20f3 --- M shell/impala_shell.py 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/63/8063/2 -- To view, visit http://gerrit.cloudera.org:8080/8063 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I453af2d4694d47e184031cb07ecd2af259ba20f3 Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Tianyi Wang Gerrit-Reviewer: Thomas Tauber-Marshall