-
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
Provide method(s) to evict connections currently in pool #6
Comments
Is this being implemented? There are serious connection leak issues with library |
There are no proper methods to signal a full eviction to the pool. We should file a ticket in https://github.com/reactor/reactor-pool/issues. |
Probably related to this issue. Sometimes I'm seeing the following warning log from netty, after enabling debug it looks like its preceded by connection release: Our r2dbc-pool settings are as follows:
Our Mysql database has 300 seconds max connection lifetime. We checked connection list on mysql side, and turns out r2dbc-pool connections are sometimes not closed properly on pool side after 280s, and mysql server has to clean them up after 300s. We are using spring boot 2.3.0, spring-boot-starter-data-r2dbc 2.3.0, r2dbc-pool 0.8.2, reactor-pool 0.1.3, r2dbc-mysql 0.8.1 - also tried bumping up r2dbc-pool & reactor-pool to newest - didn't change anything. Is there any ongoing work which might improve the situation? |
I've prepared a simple spring boot app which reproduces the problem and makes "connection closed by peer" logs visible: README.md contains very short instruction what to do. |
We're using Reactor Pool to provide general object pooling functionality. Eviction of connections only happens if there's activity on the pool. There's no background thread that evicts connections actively. Instead, the application must either borrow or return connections. Can you recheck whether this works for you if your application has pool activity if you exceed 280 seconds? |
All right, thanks for clarification. I've verified this by generating constant load, indeed pool activity causes the connections to be evicted properly. @mp911de there are no plans to change this behavior and introducing something automatic? |
It would make sense to ask |
Isn't this covered with #115? |
Actually, not, because |
@petromir 0s -> 1s -> 240s -> 300s -> So I recommend to set (backgroundEvictionInterval + maxIdleTime) < wait_time of db, then you can solve your problem |
Hi, I am currently having this problem, could you put an example of configuration based on what you just mentioned |
Method to evict(invalidate/purge) connections currently in pool.
In-use connections need to be invalidated after it is released. Or user should be able to define the behavior by passing parameter or provide separate methods for different behavior.
The text was updated successfully, but these errors were encountered: