Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2444

JDBC creates non-daemon threads that outlive user's code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.9.0
    • Client - JDBC
    • None

    Description

      I used the below maven dependency for the project :

      <dependency>
          <groupId>org.apache.drill.exec</groupId>
          <artifactId>drill-jdbc-all</artifactId>
          <version>0.8.0-SNAPSHOT</version>
          <type>pom</type>
        </dependency>
      

      When I run the below class through eclipse, I see debug messages from the JDBC code even after my man method finishes executing its last statement.

      public class Dummy {
      
      	static final String JDBC_DRIVER = "org.apache.drill.jdbc.Driver";  
      	static final String DB_URL = "jdbc:drill:schema=dfs.drillTestDirViews;zk=x.x.x.x:5181/drill-build/cluster-drillbits";
      	static Connection conn;
      	
      	public static void main(String[] args) throws Exception {
              Class.forName(JDBC_DRIVER);
      	    System.out.println("Connecting to database...");
      	    conn = DriverManager.getConnection(DB_URL);
      	    conn.close();
      	    System.out.println("End Of Main");
      	}
      }
      

      Partial output from the console :

      13:22:47.785 [Client-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacity.default: 262144
      End Of Main
      13:22:55.992 [main-SendThread(10.10.100.190:5181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x14a9c96266185ab after 0ms
      13:23:09.338 [main-SendThread(10.10.100.190:5181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x14a9c96266185ab after 1ms
      

      Even if I do not call close on the connection object, the JVM should exit when user code finishes execution.

      Let me know if you have any questions

      Attachments

        Issue Links

          Activity

            People

              rkins Rahul Kumar Challapalli
              rkins Rahul Kumar Challapalli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: