cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group