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 B1908200CB7 for ; Fri, 30 Jun 2017 22:34:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B013F160BEB; Fri, 30 Jun 2017 20:34:22 +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 27F89160BE8 for ; Fri, 30 Jun 2017 22:34:22 +0200 (CEST) Received: (qmail 89025 invoked by uid 500); 30 Jun 2017 20:34:20 -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 89010 invoked by uid 99); 30 Jun 2017 20:34:20 -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, 30 Jun 2017 20:34:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7C6B7DFE8B; Fri, 30 Jun 2017 20:34:20 +0000 (UTC) From: kkhatua To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill issue #858: DRILL-3640: Support JDBC Statement.setQueryTimeout(int) Content-Type: text/plain Message-Id: <20170630203420.7C6B7DFE8B@git1-us-west.apache.org> Date: Fri, 30 Jun 2017 20:34:20 +0000 (UTC) archived-at: Fri, 30 Jun 2017 20:34:22 -0000 Github user kkhatua commented on the issue: https://github.com/apache/drill/pull/858 Wouldn't a query cancellation automatically interrupt those potentially blocking operations? I'm simply looking up whether the trigger was a timeout DrillStatement.isTimedOut() to decide if the returning exception is a SqlTimeoutExcp. The extra thread (though mostly sleeping) didn't seem like a huge cost considering that the timeout is at the granularity of seconds. I ran a small custom JDBC client application to test this theory. Running longevity and concurrency testing worked well when testing for timeouts. For timeouts as low as 1 second for queries that needed to do lot of back end processing before returning rows much later (like a massive join), I noticed that we caught underlying exceptions as the timeouts during the 'executeQuery' call itself. If I were to not go the route of issuing a Statement.cancel() but relying primarily on the DrillCursor, unless I put in some mechanism of constantly polling for the out-of-time state of the clock. I think then I also need to cancel then cancel all operations from the level of the DrillCursor in both directions (up to the Statement and down to the fragments). All this versus issuing a Statement.cancel() that effectively cancels all the operations down to the fragment level. I am now wondering whether I missied a corner case which will be addressed by doing the timeout in the DrillCursor? --- 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. ---