Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75417102ED for ; Fri, 27 Feb 2015 08:01:56 +0000 (UTC) Received: (qmail 72712 invoked by uid 500); 27 Feb 2015 08:01:56 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 72671 invoked by uid 500); 27 Feb 2015 08:01:56 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 72595 invoked by uid 99); 27 Feb 2015 08:01:56 -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; Fri, 27 Feb 2015 08:01:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0520EE052F; Fri, 27 Feb 2015 08:01:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: json@apache.org To: commits@drill.apache.org Date: Fri, 27 Feb 2015 08:01:59 -0000 Message-Id: <92f899ae4e4f4806b7a7323616e9723f@git.apache.org> In-Reply-To: <58400024cb0a4278b32c6edd66015100@git.apache.org> References: <58400024cb0a4278b32c6edd66015100@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/9] drill git commit: DRILL-2294: Prevent collecting intermediate stats before the operator tree was finished being constructed. DRILL-2294: Prevent collecting intermediate stats before the operator tree was finished being constructed. Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/8100a970 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/8100a970 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/8100a970 Branch: refs/heads/master Commit: 8100a970cc958d61359c5b475b0cdfc67d72158b Parents: a163c06 Author: Jason Altekruse Authored: Wed Feb 25 10:29:19 2015 -0800 Committer: Jason Altekruse Committed: Thu Feb 26 16:41:03 2015 -0800 ---------------------------------------------------------------------- .../apache/drill/exec/work/fragment/FragmentExecutor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/8100a970/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java index 7ccb64e..4ab3cc0 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java @@ -64,10 +64,16 @@ public class FragmentExecutor implements Runnable, CancelableQuery, StatusProvid @Override public FragmentStatus getStatus() { - FragmentStatus status = AbstractStatusReporter.getBuilder(context, FragmentState.RUNNING, null, null).build(); + // If the query is not in a running state, the operator tree is still being constructed and + // there is no reason to poll for intermediate results. + + // Previously the call to get the operator stats with the AbstractStatusReporter was happening + // before this check. This caused a concurrent modification exception as the list of operator + // stats is iterated over while collecting info, and added to while building the operator tree. if(state.get() != FragmentState.RUNNING_VALUE){ return null; } + FragmentStatus status = AbstractStatusReporter.getBuilder(context, FragmentState.RUNNING, null, null).build(); return status; }