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 AE2722009C5 for ; Mon, 16 May 2016 23:24:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ACCF5160A16; Mon, 16 May 2016 21:24:34 +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 283D0160131 for ; Mon, 16 May 2016 23:24:34 +0200 (CEST) Received: (qmail 53825 invoked by uid 500); 16 May 2016 21:24:33 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 53804 invoked by uid 99); 16 May 2016 21:24:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2016 21:24:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D4AC9DFE16; Mon, 16 May 2016 21:24:32 +0000 (UTC) From: hnfgns To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request: DRILL-4676: Foreman.moveToState can block fore... Content-Type: text/plain Message-Id: <20160516212432.D4AC9DFE16@git1-us-west.apache.org> Date: Mon, 16 May 2016 21:24:32 +0000 (UTC) archived-at: Mon, 16 May 2016 21:24:34 -0000 Github user hnfgns commented on a diff in the pull request: https://github.com/apache/drill/pull/503#discussion_r63428428 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java --- @@ -1221,6 +1223,12 @@ public void interrupted(final InterruptedException e) { * to the user */ public void moveToState(final QueryState newState, final Exception ex) { + // if the current thread is the foreman thread, throw an exception + // otherwise the foreman will be blocked forever on acceptExternalEvents + if (myThreadRef == Thread.currentThread()) { --- End diff -- Well, Foreman does not call moveToState in common path but when it fails then it could. My point is instead of hacking the method to throw an exception if the thread is foreman we should release the latch and handle the exception in foreman#run. What I mean is Foreman#run() { ``` try { do sth } catch(ex) { release latch handleException(ex) } finally { ... } ``` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---