Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-14691

[GSS](7.3.z) MaxWaitCount will be counted one less than waiting requests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 24.0.0.Beta1, 24.0.0.Final
    • 23.0.0.Final
    • JCA
    • None
    • Hide

      1. statistics and pool setting

      /subsystem=datasources/data-source=ExampleDS:write-attribute(name=statistics-enabled,value=true)
      /subsystem=datasources/data-source=ExampleDS:write-attribute(name=max-pool-size, value=1)
      /subsystem=datasources/data-source=ExampleDS:write-attribute(name=min-pool-size, value=1)
      :reload
      

      2. build and deploy reproducer

      $ unzip h2.zip
      $ cd h2
      $ mvn package wildfly:deploy
      

      3. Send 1st request.

      $ curl -v http://localhost:8080/h2/sleep
      

      InUseCount is incremented and MaxWaitCount is still 0.

      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true)
      {
          "outcome" => "success",
          "result" => {
              "ActiveCount" => 1,
              "AvailableCount" => 0,
              ...
              "InUseCount" => 1,
              ...
              "MaxWaitCount" => 0,
      

      4. Send 2nd request before the 1st request finished.

      $ curl -v http://localhost:8080/h2/sleep
      

      You can see the MaxWaitCount returns 0 even though the waiting thread is exists.

      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true)
      {
          "outcome" => "success",
          "result" => {
              "ActiveCount" => 1,
              "AvailableCount" => 0,
              ...
              "InUseCount" => 1,
              ...
              "MaxWaitCount" => 0,
      Show
      1. statistics and pool setting /subsystem=datasources/data-source=ExampleDS:write-attribute(name=statistics-enabled,value= true ) /subsystem=datasources/data-source=ExampleDS:write-attribute(name=max-pool-size, value=1) /subsystem=datasources/data-source=ExampleDS:write-attribute(name=min-pool-size, value=1) :reload 2. build and deploy reproducer $ unzip h2.zip $ cd h2 $ mvn package wildfly:deploy 3. Send 1st request. $ curl -v http: //localhost:8080/h2/sleep InUseCount is incremented and MaxWaitCount is still 0. [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime= true ) { "outcome" => "success" , "result" => { "ActiveCount" => 1, "AvailableCount" => 0, ... "InUseCount" => 1, ... "MaxWaitCount" => 0, 4. Send 2nd request before the 1st request finished. $ curl -v http: //localhost:8080/h2/sleep You can see the MaxWaitCount returns 0 even though the waiting thread is exists. [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime= true ) { "outcome" => "success" , "result" => { "ActiveCount" => 1, "AvailableCount" => 0, ... "InUseCount" => 1, ... "MaxWaitCount" => 0,
    • Undefined

      MaxWaitCount' as DataSource statistics [1] means that the maximum number of requests waiting for a connection at the same time.
      But Actually that is one less than waiting thread counts.

      [1] https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html/configuration_guide/reference_material#reference_of_datasource_statistics

      The MaxWaitCount returns the value like the following examples.

      • max-pool-size = 1, InUseCount = 1, waiting thread 1 -> MaxWaitCount = 0.
      • max-pool-size = 1, InUseCount = 1, waiting thread 2 -> MaxWaitCount = 1.
      • max-pool-size = 2, InUseCount = 2, waiting thread 1 -> MaxWaitCount = 0.
      • max-pool-size = 2, InUseCount = 2, waiting thread 2 -> MaxWaitCount = 1.

            mshikalw Moulali Shikalwadi
            mshikalw Moulali Shikalwadi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: