Github user kkhatua commented on a diff in the pull request: https://github.com/apache/drill/pull/1024#discussion_r149546258 --- Diff: exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillCursor.java --- @@ -139,8 +147,22 @@ private boolean stopThrottlingIfSo() { return stopped; } - public void awaitFirstMessage() throws InterruptedException { - firstMessageReceived.await(); + public void awaitFirstMessage() throws InterruptedException, SQLTimeoutException { + //Check if a non-zero timeout has been set + if ( parent.timeoutInMilliseconds > 0 ) { + //Identifying remaining in milliseconds to maintain a granularity close to integer value of timeout + long timeToTimeout = (parent.timeoutInMilliseconds) - parent.elapsedTimer.elapsed(TimeUnit.MILLISECONDS); + if ( timeToTimeout > 0 ) { --- End diff -- Affects readability, but I think comments can convey the intent. +1
---