-
Notifications
You must be signed in to change notification settings - Fork 55
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 pool hangs after DB restart #138
Comments
How do you configure the connection pool? Specifically, do you configure |
I used the pool with default settings and the number of connections reduced to 1 because it's easier to reproduce the issue that way. Can still reproduce it with 10 connections, which is the default value, but it takes more DB restarts to get into a bad state. It looks like each DB restart causes a few connections to get stale. validationQuery: "SELECT 1"
validationDepth: REMOTE I've also noticed that this happens only when I use transactions, disabling them fixes the issue. Transactions are enabled in the following way: val txOperator = TransactionalOperator.create(txManager)
val flux = /* flux assembly */
flux.`as`(txOperator::transactional) |
Hi. Could you please let me know whether there are any updates on this issue or maybe you could advise what to look at so I could try debugging it myself? |
Hi, are there any updates on this issue? |
Right now, I don't have a clue whether the driver has an issue or whether the pool is missing a guard somewhere. Also, restarting a server while a connection is active (and therefore, the connection breaks) should result in an error like |
I also had the same case. common : postgreSQL 13.5 before environment
current environment (resolved)
|
Likely the pool should intercept errors of these kinds (in my case I can easily reproduce the error if I run r2dbc connection to PG over an SSH tunnel. Just restart the tunnel, and all current connections are effectively broken yet not closed. |
Hi @mp911de , Thanks for finding the root cause and posting it. I am getting the same issue "org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection nested exception is io.r2dbc.spi.R2dbcNonTransientResourceException: Connection validation failed" in MSSQL. I am using below libraries(Version). |
Bug Report
Hello. The application I'm working on is unable to obtain a connection from the pool when the DB is restarted while the app is under high load. It's not always reproducible, this problem only happens after the following exception is thrown:
Please see the full stack trace below.
Can be a duplicate for the #107 which is closed with no fix.
Please let me know if you need more information from me or steps on how to reproduce it. As noticed earlier, this only happens when the application is processing a high number of requests.
Versions
Current Behavior
Stack trace
Table schema
Input Code
-- your SQL here;
Steps to reproduce
Input Code
// your code here;
Expected behavior/code
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: