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
Maximum consumed results reached when Hikari close a SQL Server connection, leading to excessive logging #15933
Comments
Thank you very much for your report. This doesn't look like something that's easy to reproduce out of the box. Have you considered creating a minimal reproducer based on our MCVE templates here? https://github.com/jOOQ/jOOQ-mcve At the same time, what's your expectation for jOOQ here? It doesn't look like the endless loop should happen in the first place. Can you rule out any bug in Hikari or mssql-jdbc? |
Hey @lukaseder , Here is an example that you can start straight away. There are 2 conditions. You need the jooq pro dependency because it is related to the Tools with SQL SERVER dialect. Secondly, unfortunately you can't use a TestContainer because you have to produce a timeout, which I couldn't manage with the I haven't been able to figure out where the bug really is yet. I don't believe in Hikari because it only requests further exceptions. |
I'm looking into your reproducer now, thanks for your patience. I can't reproduce any issues. This is what I'm getting:
I'll try a bit more... |
From the command line:
Still not your reproducing your problem |
I'm sorry, I don't know what I should be looking for... |
Sorry I thought you set a breakpoint here:
i configured the logger now you see the log entry at the beginning
and then a lot of (256?)
Hope this helps |
I see now, thanks for the additional information. I can reproduce the problem. In my opinion, this is a bug in mssql-jdbc. Have you tried reporting it to their team (ideally by removing jOOQ first, and replicating that loop with plain JDBC)? They do not seem to correctly implement the protocol around I'm not sure if jOOQ can really do anything here. The exceptions aren't even the same instance, so mssql-jdbc always throws a new one it seems. If it had been the same instance, we could abort the loop as soon as the previous and the next exceptions are the same. I mean, we could work around this particular case by hard coding the error message and stopping the loop prematurely. Or, you can also change the log level for this particular logger. Another workaround is to lower the value of I'll make a decision about this issue later. |
Let me try that. And then I try to report a bug on driver level
Thanks, that was my first thought. Maybe you can do it public for better access? In our case there can actually be no further exception |
No. The point is, this isn't a documented thing. There's a bug, and you need a workaround.
Maybe, though, do note there's a bug somewhere (probably mssql-jdbc), and rather than documenting or implementing workarounds, the bug should be fixed. You could also proxy the JDBC driver and implement the aborting logic there. |
Hi @lukaseder I just wanted to make an example for the JDBC driver. However, I'm still unsure why this is a driver bug. Maybe you can say again why you think it's a JDBC driver bug. From my point of view, the endless loop occurs in jOOQ, because not checking if the connection is closed.
So IMHO this should be checked into the Tools class:
|
Yes, you're right. Both |
I also don't know why this didn't reproduce any issues at the time: It does generate tons of exception logs now on the computer I'm at now. |
…ver connection, leading to excessive logging
…ver connection, leading to excessive logging
…ver connection, leading to excessive logging
…ver connection, leading to excessive logging
Did you tried it before maybe with a TestContainer Image? I figured out with TestContainer image it is not reproducable because of the proxy connection |
Could be, I don't recall... |
Expected behavior
The warning is not happen and there is no endless loop
Actual behavior
Iam using Hikari as JDBC connection pool and running into a query or socket timeout.
Hikari will evict/close the connection. Then it comes to the endless loop
Steps to reproduce the problem
Set SQL Server queryTimeout to 5 seconds.
configuration.settings().setBatchSize( 100 );
Then the endless loop happen in com.zaxxer.hikari.pool.ProxyConnection#checkException when the connection will evicted.
Comes always into jOOQ Tools#consumeExceptions
jOOQ Version
jOOQ Professional 3.18.7
Database product and version
Azure SQL
Java Version
No response
OS Version
No response
JDBC driver name and version (include name if unofficial driver)
No response
The text was updated successfully, but these errors were encountered: