glassfish
  1. glassfish
  2. GLASSFISH-14686

Do not get expected JDBC connection pool monitoring information for "numconnuse-current" attribute.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.1
    • Fix Version/s: not determined
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      14,686

      Description

      When trying to get the NumConnUsed attribute from the jdbc connection pool, it
      seem it do not return the correct information.

      Please review and let us know whether this is a correct behavior.

      Step to reproduce.

      1. create a monitoring-cluster domain on a node cluster instance.

      2. set the domain resources pool size.
      ./asadmin set domain.resources.jdbc-connection-pool.MJdbcPool.max-pool-size=32

      3. Restart domain

      4. Create jdbc resource.
      ./asadmin create-jdbc-resource --connectionpoolid MJdbcPool --target
      monitoring-cluster jdbc/JDBCMonitoring

      5. Deploy an application.
      ./asadmin deploy --target monitoring-cluster
      /Users/homeryau/31_trunk_fcs_ws/appserver-sqe/common/admincli/monitoring/build/ear/jdbcapp1.ear

      6. set the monitoring jdbc-connection pool to high.
      ./asadmin set
      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH

      7. run 25 client at the same time to the server with url.
      get
      http://homer-yaus-macbook-pro.local:50942/jdbcapp1webmod1/JdbcServlet1?sleepTime=60

      8. Get the monitoring information.
      ./asadmin get -m monitoring-server.server.resources.MJdbcPool.numconnused-current

      9. I am expecting to see the current number of connection used is 25

      "monitoring-server.server.resources.MJdbcPool.numconnused-current = 25"

      but it did not, it only get "5".

      Below is the test case execution log.

      Loading test:
      /Users/homeryau/31_trunk_fcs_ws/appserver-sqe/se/admincli/monitoring/monitoringTests/jdbcconpool_21.xml
      Starting Test ########### Mon Nov 08 03:03:38 PST 2010 ############
      Loading Test :
      /var/folders/BU/BUXlZ+G7F0KaMI4fnCuk5E+++TI/Tmp/runTime_3893082510283994534.parsed
      Entering runTests method
      Test ID : jdbcconpool_21
      Test Description : get the NumConnUsed attribute from the jdbc connection pool
      /Users/homeryau/glassfish3/glassfish/bin/asadmin create-jdbc-connection-pool
      --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property
      DatabaseName=sun-appserv-samples:PortNumber=1527:serverName=localhost:connectionAttributes=;create\=true:password=APP:user=APP
      MJdbcPool
      0 : JDBC connection pool MJdbcPool created successfully.
      monitoring-server :
      JDBC connection pool MJdbcPool created successfully.

      Command create-jdbc-connection-pool executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin set
      domain.resources.jdbc-connection-pool.MJdbcPool.max-pool-size=32
      0 : domain.resources.jdbc-connection-pool.MJdbcPool.max-pool-size=32

      Command set executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin set
      monitoring-cluster.http-service.request-processing.thread-count=50
      1 : Command set failed.
      remote failure: No configuration found for
      monitoring-cluster.http-service.request-processing

      /Users/homeryau/glassfish3/glassfish/bin/asadmin stop-instance monitoring-server
      0 : The instance, monitoring-server, is stopped.

      Command stop-instance executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin start-instance monitoring-server
      0 : Waiting for monitoring-server to start ...............
      Successfully started the instance: monitoring-server
      instance Location:
      /Users/homeryau/glassfish3/glassfish/nodes/homer-yaus-macbook-pro.local_magent/monitoring-server
      Log File:
      /Users/homeryau/glassfish3/glassfish/nodes/homer-yaus-macbook-pro.local_magent/monitoring-server/logs/server.log
      Admin Port: 24848
      Command start-local-instance executed successfully.
      The instance, monitoring-server, was started on host homer-yaus-macbook-pro.local

      Command start-instance executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin create-jdbc-resource
      --connectionpoolid MJdbcPool --target monitoring-cluster jdbc/JDBCMonitoring
      0 : JDBC resource jdbc/JDBCMonitoring created successfully.
      monitoring-server :
      JDBC resource jdbc/JDBCMonitoring created successfully.

      Command create-jdbc-resource executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin deploy --target
      monitoring-cluster
      /Users/homeryau/31_trunk_fcs_ws/appserver-sqe/common/admincli/monitoring/build/ear/jdbcapp1.ear
      0 : Application deployed with name jdbcapp1.

      Command deploy executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin set
      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH
      0 : monitoring-server :
      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH

      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=HIGH

      Command set executed successfully.

      command :
      HttpClient :25 client(s) and 1 iterations
      running in background
      get
      http://homer-yaus-macbook-pro.local:50942/jdbcapp1webmod1/JdbcServlet1?sleepTime=60
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      noOfIterations1
      In sleepNode method
      Sleeping for :5
      /Users/homeryau/glassfish3/glassfish/bin/asadmin get -m
      monitoring-server.server.resources.MJdbcPool.numconnused-current
      0 : monitoring-server :
      monitoring-server.server.resources.MJdbcPool.numconnused-current = 5

      Command get executed successfully.

      In sleepNode method
      Sleeping for :130
      /Users/homeryau/glassfish3/glassfish/bin/asadmin set
      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=OFF
      0 : monitoring-server :
      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=OFF

      monitoring-cluster.monitoring-service.module-monitoring-levels.jdbc-connection-pool=OFF

      Command set executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin delete-jdbc-resource --target
      monitoring-cluster jdbc/JDBCMonitoring
      0 : JDBC resource jdbc/JDBCMonitoring deleted successfully
      monitoring-server :
      JDBC resource jdbc/JDBCMonitoring deleted successfully

      Command delete-jdbc-resource executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin delete-jdbc-connection-pool
      MJdbcPool
      0 : JDBC Connection pool MJdbcPool deleted successfully
      monitoring-server :
      JDBC Connection pool MJdbcPool deleted successfully

      Command delete-jdbc-connection-pool executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin undeploy jdbcapp1
      1 : Command undeploy failed.
      remote failure: Application jdbcapp1 is not deployed on this target [server]

      /Users/homeryau/glassfish3/glassfish/bin/asadmin stop-instance monitoring-server
      0 : The instance, monitoring-server, is stopped.

      Command stop-instance executed successfully.

      /Users/homeryau/glassfish3/glassfish/bin/asadmin start-instance monitoring-server
      0 : CLI801 Instance is already synchronized
      Waiting for monitoring-server to start ................
      Successfully started the instance: monitoring-server
      instance Location:
      /Users/homeryau/glassfish3/glassfish/nodes/homer-yaus-macbook-pro.local_magent/monitoring-server
      Log File:
      /Users/homeryau/glassfish3/glassfish/nodes/homer-yaus-macbook-pro.local_magent/monitoring-server/logs/server.log
      Admin Port: 24848
      Command start-local-instance executed successfully.
      The instance, monitoring-server, was started on host homer-yaus-macbook-pro.local

      Command start-instance executed successfully.

      Pass pattern didnot match
      Pass Pattern Expected
      :monitoring-server.server.resources.MJdbcPool.numconnused-current = 25
      Test FAILED
      Ending Test ########### 3:7:20 ############

        Activity

        Hide
        Jagadish added a comment -

        I tried the above steps and it does not seem to work. (test configuration fails).

        • Please provide exact steps to reproduce.
        • Is the behavior seen in DAS based test also ?
          (There is not real difference w.r.t DAS/Cluster/instance in monitoring stats collection behavior).
        • If you are able to reproduce this, please enable FINEST logging for "javax.enterprise.resource.resourceadapter", recycle server.log and start the test.
          "Connection Used event received" FINEST logging will be seen in server.log. Number of occurrences in server.log should match the actual requests made.

        I have also added a configurable dev-test in jdbc tests :
        "appserv-tests/devtests/jdbc/connection-pool-perf"
        Refer :
        http://java.net/projects/glassfish/sources/svn/content/trunk/v2/appserv-tests/devtests/jdbc/connection-pool-perf/README?rev=43276

        Please refer README to checkout and run tests :
        http://java.net/projects/glassfish/sources/svn/content/trunk/v2/appserv-tests/devtests/jdbc/README.txt
        Refer the section in the above link to run an individual test-case (connection-pool-perf) :
        "(2) TO CHECKOUT AND RUN A PARTICULAR TEST CASE ALONE :"

        Will mark the issue as not reproducible as it works fine in the above test-case (with multiple configurations)

        Show
        Jagadish added a comment - I tried the above steps and it does not seem to work. (test configuration fails). Please provide exact steps to reproduce. Is the behavior seen in DAS based test also ? (There is not real difference w.r.t DAS/Cluster/instance in monitoring stats collection behavior). If you are able to reproduce this, please enable FINEST logging for "javax.enterprise.resource.resourceadapter", recycle server.log and start the test. "Connection Used event received" FINEST logging will be seen in server.log. Number of occurrences in server.log should match the actual requests made. I have also added a configurable dev-test in jdbc tests : "appserv-tests/devtests/jdbc/connection-pool-perf" Refer : http://java.net/projects/glassfish/sources/svn/content/trunk/v2/appserv-tests/devtests/jdbc/connection-pool-perf/README?rev=43276 Please refer README to checkout and run tests : http://java.net/projects/glassfish/sources/svn/content/trunk/v2/appserv-tests/devtests/jdbc/README.txt Refer the section in the above link to run an individual test-case (connection-pool-perf) : "(2) TO CHECKOUT AND RUN A PARTICULAR TEST CASE ALONE :" Will mark the issue as not reproducible as it works fine in the above test-case (with multiple configurations)
        Show
        Jagadish added a comment - Sample console log of the test : http://java.net/projects/glassfish/sources/svn/content/trunk/v2/appserv-tests/devtests/jdbc/connection-pool-perf/sample-console.log?rev=43276
        Hide
        Homer Yau added a comment -

        By setting the cluster config http-thread-pool size to 50 now the test case is passing.

        For example:
        asadmin set monitoring-cluster-config.thread-pools.thread-pool.http-thread-pool.max-thread-pool-size=50

        Show
        Homer Yau added a comment - By setting the cluster config http-thread-pool size to 50 now the test case is passing. For example: asadmin set monitoring-cluster-config.thread-pools.thread-pool.http-thread-pool.max-thread-pool-size=50

          People

          • Assignee:
            Jagadish
            Reporter:
            Homer Yau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: