Closed ColaCheng closed 7 months ago
@ColaCheng yes I've been wanting to add this. Although it will not solve the issue of that long running query in the background because of the connection pool. If your connection pool is 2 then there is no guarantee that the interrupt will be routed to the problematic "connection".
That being said, thank you for implementing this and I'll get this merged. 😄
Released under v0.21.0
We encounter the db connection can not be closed when a long-running query gets a timeout(Ecto environment) but the query is still running in the background and takes the CPU resource. For this function, we can manually trigger and force-stop the query. Then we can close and release the resource successfully.
Ref: https://www.sqlite.org/c3ref/interrupt.html