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