You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Daniel Barclay (Drill) (JIRA)" <ji...@apache.org> on 2015/03/02 23:24:04 UTC

[jira] [Comment Edited] (DRILL-1735) JDBC driver's close() leaks resources in local mode

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

Daniel Barclay (Drill) edited comment on DRILL-1735 at 3/2/15 10:23 PM:
------------------------------------------------------------------------

TEMPORARY:  Latest draft is in https://github.com/dsbos/incubator-drill, in branch 
bugs/drill-1735-jdbc_close_Core_me_master_03-02_SQUASHED_03-02d 
(last commit; core patch) plus
bugs/drill-1735-jdbc_close_2_Hygiene1_WORK_re_Chriss2245Patches_02-28_and_master_03-01 (commits with "DRILL-1735-releated"; hygiene patch).

(Latter is to be re-squashed and generated into patch.)


was (Author: dsbos):
TEMPORARY:  Latest draft is in https://github.com/dsbos/incubator-drill, in branch temp_ChrisPatches_and_1735_try2 (last several commit labeled with 1735).

(Is to be moved to regular personal dev. branch, re-squashed, and generated into new diff/patch.)

> JDBC driver's close() leaks resources in local mode
> ---------------------------------------------------
>
>                 Key: DRILL-1735
>                 URL: https://issues.apache.org/jira/browse/DRILL-1735
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>            Priority: Critical
>             Fix For: 0.8.0
>
>         Attachments: Bug1735CloseDoesntCloseTest.java, DRILL-1735.10.patch.txt, DRILL-1735.11.patch.txt, DRILL-1735.12.patch.txt, DRILL-1735.6.patch.txt, DRILL-1735.9.patch.txt
>
>
> When the Drill JDBC driver is used in local mode (as  DriverManager.getConnection("jdbc:drill:zk=local", ... ), the close() method doesn't free resources:  Calling getConnection() and then close() and then repeating that pair of calls enough times results in an exception, the root cause exeception of which is an IOException saying "Too many open files":
> java.sql.SQLException: Failure while attempting to start Drillbit in embedded mode.
> 	at org.apache.drill.jdbc.DrillConnectionImpl.<init>(DrillConnectionImpl.java:81)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory$DrillJdbc41Connection.<init>(DrillJdbc41Factory.java:88)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:57)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:1)
> 	at org.apache.drill.jdbc.DrillFactory.newConnection(DrillFactory.java:51)
> 	at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:571)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:187)
> 	at temp.Bug1735CloseDoesntCloseTest.testBug(Bug1735CloseDoesntCloseTest.java:26)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> Caused by: java.lang.IllegalStateException: failed to create a child event loop
> 	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:68)
> 	at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:49)
> 	at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:61)
> 	at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:52)
> 	at org.apache.drill.exec.rpc.TransportCheck.createEventLoopGroup(TransportCheck.java:75)
> 	at org.apache.drill.exec.server.BootStrapContext.<init>(BootStrapContext.java:45)
> 	at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:95)
> 	at org.apache.drill.jdbc.DrillConnectionImpl.<init>(DrillConnectionImpl.java:78)
> 	... 18 more
> Caused by: io.netty.channel.ChannelException: failed to open a new selector
> 	at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:128)
> 	at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:120)
> 	at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:87)
> 	at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:64)
> 	... 25 more
> Caused by: java.io.IOException: Too many open files
> 	at sun.nio.ch.IOUtil.makePipe(Native Method)
> 	at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:126)
> 	... 28 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)