glassfish
  1. glassfish
  2. GLASSFISH-17265

The task checking idle connections is scheduled using previous idleTimeout value on reconfiguration

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 3.1.2_b13, 4.0
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      When changing idletimeout after initialization of JDBC connection pool, the reconfiguration of pool is executed.
      In this case, I expected the task checking idle connections would adopt the updated idletimeout value.
      However it still seems to use the previous idletimeout value after reconfiguration.

      [Reproducible steps]

      1. asadmin set resources.jdbc-connection-pool.DerbyPool.pooling=true
        asadmin set resources.jdbc-connection-pool.DerbyPool.steady-pool-size=8
        asadmin set resources.jdbc-connection-pool.DerbyPool.idle-timeout-in-seconds=10
      2. Getting a connection using DerbyPool. (DerbyPool is initialized on first getConnection().)
      3. asadmin set resources.jdbc-connection-pool.DerbyPool.idle-timeout-in-seconds=30
      4. Sleep 20 (sec)
      5. Idle connections are destroyed though idletimeout is 30 (sec).

      Note that I couldn't always reproduce this issue by following the above steps. It might depend on the machine spec. So I confirmed the previous idletimeout value was passed Timer for ResizerTask directly on debug.

      [Reason]
      A variable idletime which is used in scheduleResizerTask() is not updated as follows.

      com.sun.enterprise.resource.pool.ConnectionPool.java
      public synchronized void reconfigurePool(ConnectorConnectionPool poolResource) throws PoolingException {
          int _idleTime = Integer.parseInt(poolResource.getIdleTimeoutInSeconds())
                  * 1000;
          if (poolInitialized) {
              if (_idleTime != idletime && _idleTime != 0) {
                  scheduleResizerTask();//idletime was not updated
              }
              if (_idleTime == 0) {
                  //resizerTask.cancel();
                  cancelResizerTask();
              }
          }
          idletime = _idleTime;//idletime will be updated here
          ...
      }
      
      private void scheduleResizerTask() {
          ...
          timer.scheduleAtFixedRate(resizerTask, idletime, idletime);// the previous idletime was passed 
          ...
      }
      

      I tested using GFv3.2(r48897).

        Activity

        Hide
        Shalini added a comment -

        Fixed in trunk.

        Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
        Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
        Transmitting file data ..
        Committed revision 51293.

        Show
        Shalini added a comment - Fixed in trunk. Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java Sending appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java Transmitting file data .. Committed revision 51293.
        Hide
        Shalini added a comment -

        Fixed in 3.1.2

        Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java
        Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java
        Transmitting file data ..
        Committed revision 51297.

        Show
        Shalini added a comment - Fixed in 3.1.2 Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/ConnectionPool.java Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/resource/pool/UnpooledResource.java Transmitting file data .. Committed revision 51297.

          People

          • Assignee:
            Shalini
            Reporter:
            ito_m
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: