From issues-return-51906-archive-asf-public=cust-asf.ponee.io@drill.apache.org Mon Apr 16 21:59:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0227318077A for ; Mon, 16 Apr 2018 21:59:03 +0200 (CEST) Received: (qmail 82337 invoked by uid 500); 16 Apr 2018 19:59:03 -0000 Mailing-List: contact issues-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 issues@drill.apache.org Received: (qmail 82175 invoked by uid 99); 16 Apr 2018 19:59:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2018 19:59:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A55661A1749 for ; Mon, 16 Apr 2018 19:59:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GB_CDufW8f3U for ; Mon, 16 Apr 2018 19:59:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 38BB85FCEF for ; Mon, 16 Apr 2018 19:59:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9BD8FE0BE9 for ; Mon, 16 Apr 2018 19:59:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4B75F241C7 for ; Mon, 16 Apr 2018 19:59:00 +0000 (UTC) Date: Mon, 16 Apr 2018 19:59:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-6295) PartitionerDecorator may close partitioners while CustomRunnable are active during query cancellation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-6295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439962#comment-16439962 ] ASF GitHub Bot commented on DRILL-6295: --------------------------------------- Github user vrozov commented on a diff in the pull request: https://github.com/apache/drill/pull/1208#discussion_r181865979 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerDecorator.java --- @@ -118,105 +127,114 @@ public PartitionOutgoingBatch getOutgoingBatches(int index) { return null; } - @VisibleForTesting - protected List getPartitioners() { + List getPartitioners() { return partitioners; } /** * Helper to execute the different methods wrapped into same logic * @param iface - * @throws IOException + * @throws ExecutionException */ - protected void executeMethodLogic(final GeneralExecuteIface iface) throws IOException { - if (partitioners.size() == 1 ) { - // no need for threads - final OperatorStats localStatsSingle = partitioners.get(0).getStats(); - localStatsSingle.clear(); - localStatsSingle.startProcessing(); + @VisibleForTesting + void executeMethodLogic(final GeneralExecuteIface iface) throws ExecutionException { + // To simulate interruption of main fragment thread and interrupting the partition threads, create a + // CountDownInject latch. Partitioner threads await on the latch and main fragment thread counts down or + // interrupts waiting threads. This makes sure that we are actually interrupting the blocked partitioner threads. + try (CountDownLatchInjection testCountDownLatch = injector.getLatch(context.getExecutionControls(), "partitioner-sender-latch")) { --- End diff -- The `testCountDownLatch` is used only for testing and initialized to 1. The wait is on `count`. > PartitionerDecorator may close partitioners while CustomRunnable are active during query cancellation > ----------------------------------------------------------------------------------------------------- > > Key: DRILL-6295 > URL: https://issues.apache.org/jira/browse/DRILL-6295 > Project: Apache Drill > Issue Type: Bug > Reporter: Vlad Rozov > Assignee: Vlad Rozov > Priority: Critical > Fix For: 1.14.0 > > > During query cancellation, in case {{PartitionerDecorator.executeMethodLogic()}} is active (waiting on the {{latch}}), the wait will be interrupted and {{Futures}} cancelled, but there is no guarantee that all {{CustomRunnable}} terminate before returning from {{PartitionerDecorator.executeMethodLogic()}}. On exit, both income and outgoing batches are cleared, leading to clearing of underlying {{Vectors}} and {{DrillBufs}}. This eventually causes unallocated memory access and JVM crash as {{CustomRunnable}} may execute after income/outgoing batches are cleared. -- This message was sent by Atlassian JIRA (v7.6.3#76005)