cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

threads leakage when getConnection fails

olegmir
New Contributor III

Hi,

we are using databricks jdbc https://mvnrepository.com/artifact/com.databricks/databricks-jdbc/2.6.33

it seems like there is a thread leakage when getConnection fails

could anyone advice?

can be reproduced with

    @Test
    void databricksThreads() {
        while(true) {
            String server = "put_you_server_here";
            String url = "jdbc:databricks://" + server + ":443;HttpPath=dummy_path;TransportMode=http;";

            DataSource dataSource = new DataSource();
            dataSource.setURL(url);

            try (Connection connection = dataSource.getConnection()){

            } catch (Exception e) {
                System.out.println("ManagementFactory.getThreadMXBean().getThreadCount() " + ManagementFactory.getThreadMXBean().getThreadCount());
            }
        }
    }

///////

ManagementFactory.getThreadMXBean().getThreadCount() 582
ManagementFactory.getThreadMXBean().getThreadCount() 583
ManagementFactory.getThreadMXBean().getThreadCount() 584
ManagementFactory.getThreadMXBean().getThreadCount() 585
ManagementFactory.getThreadMXBean().getThreadCount() 586
ManagementFactory.getThreadMXBean().getThreadCount() 587
ManagementFactory.getThreadMXBean().getThreadCount() 588
ManagementFactory.getThreadMXBean().getThreadCount() 589
ManagementFactory.getThreadMXBean().getThreadCount() 590
ManagementFactory.getThreadMXBean().getThreadCount() 591
ManagementFactory.getThreadMXBean().getThreadCount() 592
ManagementFactory.getThreadMXBean().getThreadCount() 593
ManagementFactory.getThreadMXBean().getThreadCount() 594
ManagementFactory.getThreadMXBean().getThreadCount() 595
ManagementFactory.getThreadMXBean().getThreadCount() 596
ManagementFactory.getThreadMXBean().getThreadCount() 597
ManagementFactory.getThreadMXBean().getThreadCount() 598

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

olegmir
New Contributor III

Hi,

none of the above suggestion will not work...

we already contacted databricks jdbc team, 

thread leakage was confirmed and was fixed in version 2.6.34

https://mvnrepository.com/artifact/com.databricks/databricks-jdbc/2.6.34
this leakage still exist if you are using Datasource to establish connection.

using DriverManager and version 2.6.34 solves the issue.

View solution in original post

1 REPLY 1

olegmir
New Contributor III

Hi,

none of the above suggestion will not work...

we already contacted databricks jdbc team, 

thread leakage was confirmed and was fixed in version 2.6.34

https://mvnrepository.com/artifact/com.databricks/databricks-jdbc/2.6.34
this leakage still exist if you are using Datasource to establish connection.

using DriverManager and version 2.6.34 solves the issue.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now