Skip to content

(DuckDBConnection) DriverManager.getConnection stuck #277

@huhao0926

Description

@huhao0926

the first time to execute following code,then is ok
"""
conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:")
// execute query
conn.close
"""

but when get connection again, processs will hang
java stack
"http-nio-5201-exec-13" #127 daemon prio=5 os_prio=0 tid=0x00007fe13c008000 nid=0x9516 runnable [0x00007fe0711d3000]
java.lang.Thread.State: RUNNABLE
at org.duckdb.DuckDBNative.duckdb_jdbc_startup(Native Method)
at org.duckdb.DuckDBConnection.newConnection(DuckDBConnection.java:52)
at org.duckdb.DuckDBDriver.connect(DuckDBDriver.java:48)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at cn.huolala.diagnose.duckdb.DuckDBUtil.getConnection(DuckDBUtil.java:45)

i make sure it hang with following native so, the code is
db_instance_cache.cpp:58
// if the database does not exist, but the cache entry still exists, the database is being shut down
// we need to wait until the database is fully shut down to safely proceed
// we do this here using a busy spin
while (cache_entry) {
// clear our cache entry
cache_entry.reset();
// try to lock it again
cache_entry = entry->second.lock(); // here
}

is there some advice, I need help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions