-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection leak on execute (Hikari) #11
Comments
In follow up I'd like to add I've discovered another situation in which a connection is leaked, namely on |
Okay, I'm on vacation but I'll look at it when I get back in a few days. If you can please confirm it's not an issue with Hikari or the MySQL driver and that it is RxKotlin-JDBC that is the source of the issue |
Hmm... yes there is something that doesn't look right here when comparing the implementation of |
@Warkst Alright, I implemented a fix. Can you test a build? You can use JitPack to bring this in as a dependency: |
Thanks @thomasnield for looking into this. I'm still experiencing connection leaks when something like
results in an exception. |
Hi! |
Any updates on this?? |
I'm using rxkotlin-jdbc and a Hikari data source in a TornadoFX project and found that a connection is leaking whenever I use
fun DataSource.execute
to delete objects from an underlying PostgreSQL database. I came across this by enabling logging with the JVM parameter-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=debug
and setting the hikari config'sleakDetectionThreshold
property to 60_000 ms, which showed the following output in my console:The specific function in violation:
jdk: 1.8.0_144
kotlin version: 1.3.10
rxkotlinfx maven version: 2.2.2
hikaricp maven version: 3.2.0
Not sure this is a bug of Hikari or rxkotlin-jdbc, but I found that swapping the
execute
toinsert
(andtoSingle()
totoSingle{true}
) fixes the leak. Seems like the connection is not being closed and returned to the pool correctly?The text was updated successfully, but these errors were encountered: