fix: properly disconnect agent-based database connections

PoolKind::Agent had a no-op disconnect handler, which meant closing
connections for agent-driven databases (KingbaseES, Oracle, Dameng, etc.)
never actually sent a disconnect command to the Java agent process.
The JDBC connection was only released when the process was eventually
killed via Drop, which could leave stale sessions alive on reconnect.
This commit is contained in:
t8y2 2026-05-27 18:00:50 +08:00
parent 76409d3313
commit 4207a891d1
1 changed files with 4 additions and 1 deletions

View File

@ -482,7 +482,10 @@ pub async fn disconnect_db(state: State<'_, Arc<AppState>>, connection_id: Strin
PoolKind::ClickHouse(_) => {}
PoolKind::SqlServer(_) => {}
PoolKind::Elasticsearch(_) => {}
PoolKind::Agent(_) => {}
PoolKind::Agent(client) => {
let mut client = client.lock().await;
let _ = client.disconnect().await;
}
PoolKind::ExternalTabular(_) => {}
PoolKind::ExternalDriver { .. } => {}
}