Chat2DB Edition
Chat2DB Community
Chat2DB Version
main at 2442df9
Deployment
Web, Desktop, and embedded backend
Operating System
Any
Problem Summary
JdbcJarUtils configures the asynchronous OkHttp Dispatcher with Executors.newFixedThreadPool(20). The default thread factory creates non-daemon workers and the static executor is never shut down, so the first asynchronous driver download can keep the JVM alive after the application context closes. Downloads also write directly to the final jar path, which makes an interrupted process expose a partial driver file.
Steps to Reproduce
- Remove a startup JDBC driver jar so JarDownloadTask triggers JdbcJarUtils.asyncDownload.
- Let the asynchronous request start or complete.
- Close the Spring or embedded application context without calling System.exit.
- Observe the JVM process and the driver directory during an interrupted download.
Expected Behavior
Download workers do not prevent normal JVM shutdown, and only complete driver jars are published at their final paths.
Actual Behavior
Up to 20 non-daemon fixed-pool workers remain alive indefinitely. A forced shutdown can also leave a truncated file at the final jar path, and the next startup may treat its existence as a completed download.
Logs
No error is required; the worker threads wait on the executor queue after the request completes.
Screenshots or Additional Context
The executor is static, core threads do not time out, and no shutdown path exists. Any daemon-thread fix must publish through a temporary file before atomically replacing the final jar to avoid making interrupted downloads visible.
Impact
Natural shutdown can hang in tests, embedded use, or controlled application exits. Interrupted downloads can leave an unusable JDBC driver cached across restarts.
Workaround
Force-terminate the JVM and manually delete any truncated driver jar before restarting.
Submission Checklist
Chat2DB Edition
Chat2DB Community
Chat2DB Version
main at 2442df9
Deployment
Web, Desktop, and embedded backend
Operating System
Any
Problem Summary
JdbcJarUtils configures the asynchronous OkHttp Dispatcher with Executors.newFixedThreadPool(20). The default thread factory creates non-daemon workers and the static executor is never shut down, so the first asynchronous driver download can keep the JVM alive after the application context closes. Downloads also write directly to the final jar path, which makes an interrupted process expose a partial driver file.
Steps to Reproduce
Expected Behavior
Download workers do not prevent normal JVM shutdown, and only complete driver jars are published at their final paths.
Actual Behavior
Up to 20 non-daemon fixed-pool workers remain alive indefinitely. A forced shutdown can also leave a truncated file at the final jar path, and the next startup may treat its existence as a completed download.
Logs
No error is required; the worker threads wait on the executor queue after the request completes.
Screenshots or Additional Context
The executor is static, core threads do not time out, and no shutdown path exists. Any daemon-thread fix must publish through a temporary file before atomically replacing the final jar to avoid making interrupted downloads visible.
Impact
Natural shutdown can hang in tests, embedded use, or controlled application exits. Interrupted downloads can leave an unusable JDBC driver cached across restarts.
Workaround
Force-terminate the JVM and manually delete any truncated driver jar before restarting.
Submission Checklist