drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3640) Drill JDBC driver support Statement.setQueryTimeout(int)
Date Wed, 15 Nov 2017 23:50:00 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16254472#comment-16254472
] 

ASF GitHub Bot commented on DRILL-3640:
---------------------------------------

Github user kkhatua commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1024#discussion_r151286559
  
    --- Diff: exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillResultSetImpl.java ---
    @@ -96,6 +105,14 @@ private void throwIfClosed() throws AlreadyClosedSqlException,
             throw new AlreadyClosedSqlException( "ResultSet is already closed." );
           }
         }
    +
    +    //Implicit check for whether timeout is set
    +    if (elapsedTimer != null) {
    --- End diff --
    
    So, I used your approach and made a modification to injecting the pause for `sending-data`
() in the `ScreenCreator` class.
    ```
    org.apache.drill.jdbc.SqlTimeoutException: Query timed out in 2 seconds
            at org.apache.drill.jdbc.impl.DrillCursor$ResultsListener.awaitFirstMessage(DrillCursor.java:156)
            at org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:588)
            at org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1917)
            at org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:65)
            at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:473)
            at org.apache.drill.jdbc.impl.DrillMetaImpl.prepareAndExecute(DrillMetaImpl.java:1100)
            at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
            at org.apache.drill.jdbc.impl.DrillConnectionImpl.prepareAndExecuteInternal(DrillConnectionImpl.java:191)
            at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:110)
            at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:130)
            at org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:112)
            at org.apache.drill.jdbc.StatementTest.testServerTriggeredQueryTimeout(StatementTest.java:206)
    ```
    
    However, since the executeQuery() call failed, I don't have a queryId to unpause at the
injection.
    Closing the (test-specific) connection did not help release back memory.
    ```
    15:43:41.818 [Thread-8] ERROR o.a.d.exec.server.BootStrapContext - Pool did not terminate
    15:43:41.836 [Thread-8] ERROR o.a.d.exec.server.BootStrapContext - Error while closing
    java.lang.IllegalStateException: Allocator[ROOT] closed with outstanding child allocators.
    Allocator(ROOT) 0/30180480/33376320/3221225472 (res/actual/peak/limit)
      child allocators: 2
        Allocator(query:25f32edb-db10-4f8a-6a9c-58b0b455c0ab) 1048576/0/0/268435456 (res/actual/peak/limit)
    ....
            at org.apache.drill.exec.memory.BaseAllocator.close(BaseAllocator.java:496) ~[drill-memory-base-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76) [drill-common-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:64) [drill-common-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.exec.server.BootStrapContext.close(BootStrapContext.java:256)
~[drill-java-exec-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76) [drill-common-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:64) [drill-common-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.exec.server.Drillbit.close(Drillbit.java:205) [drill-java-exec-1.12.0-SNAPSHOT.jar:1.12.0-SNAPSHOT]
            at org.apache.drill.jdbc.impl.DrillConnectionImpl.cleanup(DrillConnectionImpl.java:817)
[classes/:na]
            at org.apache.drill.jdbc.impl.DrillHandler.onConnectionClose(DrillHandler.java:36)
[classes/:na]
            at org.apache.calcite.avatica.AvaticaConnection.close(AvaticaConnection.java:156)
[calcite-avatica-1.4.0-drill-r23.jar:1.4.0-drill-r23]
            at org.apache.drill.jdbc.StatementTest.testServerTriggeredQueryTimeout(StatementTest.java:225)
[test-classes/:na]
    ```
    
    Any idea on how I can _resume_ such a query without the queryId?


> Drill JDBC driver support Statement.setQueryTimeout(int)
> --------------------------------------------------------
>
>                 Key: DRILL-3640
>                 URL: https://issues.apache.org/jira/browse/DRILL-3640
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Client - JDBC
>    Affects Versions: 1.2.0
>            Reporter: Chun Chang
>            Assignee: Kunal Khatua
>             Fix For: 1.12.0
>
>
> It would be nice if we have this implemented. Run away queries can be automatically canceled
by setting the timeout. 
> java.sql.SQLFeatureNotSupportedException: Setting network timeout is not supported.
> 	at org.apache.drill.jdbc.impl.DrillStatementImpl.setQueryTimeout(DrillStatementImpl.java:152)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message