Github user sakalaramesh commented on a diff in the pull request:
https://github.com/apache/tomcat/pull/54#discussion_r216162039
--- Diff:
modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java
---
@@ -622,6 +622,11 @@ protected void release(PooledConnection con) {
// notified
if (waitcount.get() > 0) {
idle.offer(create(true));
+
+ // we also want to respect the minimum number of idle connections
+ // (if the connection pool is closing do not create new
connections!)
+ } else if (idle.size() + busy.size() <
getPoolProperties().getMinIdle() && !isClosed()) {
+ idle.offer(create(true));
--- End diff --
filling idle queue I think should be part of the PoolCleaner instead of
being part of the release(), especially if poolSweeper is enabled. release() is
invoked while application request is waiting most of the time.
Also, minIdle is for number of idle connections, not the total of idle+busy
connections. Shouldn't we be filling idle queue when idle queue size falls
below minIdle independent of busy queue size?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]