Bug #109681 NullPointerException in StatementImpl::getWarnings
Submitted: 18 Jan 13:45 Modified: 24 Jan 9:35
Reporter: Jens Teglhus Møller Email Updates:
Status: Analyzing Impact on me:
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0.31 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[18 Jan 13:45] Jens Teglhus Møller

There seems to be some kind of race condition between closing connections and statements.

I'm able to reliable trigger a NullPointerException in StatementImpl::getWarnings due to session being null (because the connection was closed by another thread).

I initially thought this was a problem related to interactions between the hikaricp connection pool and the jooq framework, but after reporting the bug on the jooq mailing list <https://groups.google.com/g/jooq-user/c/mvrKSt47h4Q> I was directed here.

How to repeat:
There is probably a simple way to trigger this, but I have created a small project on github that reproduces it by using testcontainers, hikaricp and jooq: https://github.com/djarnis73/jooq-hikari

If that is too much clutter, I can see if I can reproduce it without involving third party libraries.