Sorry again. Docs are here (at the bottom in the abandoned config section):
https://commons.apache.org/proper/commons-dbcp/configuration.html
On 12/6/21 10:01 AM, Phil Steitz wrote:
On 12/5/21 2:34 PM, Jerry Malcolm wrote:
Phil,
Thanks for the response. I saw that note in the docs that said the
removeAbandonedOnMaintenance wouldn't do anything without an evictor
service. But removeAbandonedOnBorrow also requires an evictor
service to run in order remove on borrow? That's fine. Just a bit
confusing that on-borrow requires a timed eviction run. I'll do
whatever it takes. Again, just trying to figure it all out.
I am sorry. My mistake. I saw the removeAbandonOnMaintenance and not
the other one. You are correct that with removeAbandonedOnBorrow on
you should not need to have the evictor turned on (though it will
obviously only run on borrow). The docs could be clearer on this
(seems some have been moved / deleted), but when
removeAbandonedOnMaintenance is on, actual removal only happens when
there are fewer than 2 idle objects available in the pool and
getNumActive() > getMaxTotal() - 3.
Phil
Jerry
On 12/5/2021 12:19 PM, Phil Steitz wrote:
In order for abandoned connection cleanup to happen, you have to
have configured a maintenance (aka "evictor") thread to run. You
need to set the value of timeBetweenEvictionRunsMillis to a positive
number.
Phil
On 12/4/21 9:06 PM, Jerry Malcolm wrote:
I had a db connection leak in my code where an error condition
would throw an exception and bypass the connection cleanup code. I
found that and fixed it. But before I found the problem, my
program was overrunning the max connections and locking out. It
would take sometimes 12 hours after a reboot to go from 0
connections to max. Normal steady state connections should
currently be under 50. The ramp over several hours to max was very
obvious in my numActive log. What I'm confused about is why
removeAbandoned didn't recover those connections. Granted, if I
write my code correctly, removeAbandoned shouldn't be necessary.
The coding problem is solved now. But apparently my
understanding/configuration of removeAbandoned is not correct. I'd
like to have that figured out in case there's a next time (which
sadly there probably will be....). Basically, with the
configuration below, I'm not getting any idle connections detected
and returned. This is TC 8.5.73. And the leak was happening on a
basic request/response (no threads involved). I requested the
connection, encountered an error, and returned without closing the
connection. Ideas? Thx.
<Resource name="jdbc/-----"
url="jdbc:mysql://db1.-----.---/-----"
maxTotal="320"
maxIdle="3"
username="-----------"
password="-----------"
auth="Container"
type="javax.sql.DataSource"
maxWaitMillis="30000"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
removeAbandonedTimeout="15"
logAbandoned="true"
driverClassName="com.mysql.cj.jdbc.Driver" />
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org