You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sakalaramesh <gi...@git.apache.org> on 2018/09/09 16:29:17 UTC

[GitHub] tomcat pull request #54: Respect minimum pool size [#61032]

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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org