glassfish
  1. glassfish
  2. GLASSFISH-13789

3.1 deployment performance - thread/threadpool usage for the annotation scanning

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1_b25
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      13,789

      Description

      This is one of Tom's observations when he studied the 3.1 deployment profile:

      ==============================================
      There are 2 threads that are created for each loop, and they are only used for
      a single operation. Many of these threads are running the
      ReadableArchiveScannerAdapter class within a FutureTask. I see that
      ReadableArchiveScannerAdapter is used by the
      ApplicationLifecycle.getDeployableTypes method which is called by
      ApplicationLifecycle.deploy. The getDeployableTypes method calls an HK2 Parser
      class that uses a fixed thread pool of size 1 to parse the WAR file. After it
      is done parsing, it shutdown the the thread pool. So this explains why at
      least one thread is only used once. I'm not sure what the other thread is for.
      Also, since the getDeployableTypes has the following:

      parser.parse(scannerAdapter, null);
      parser.awaitTermination();

      I'm not sure why a separate thread pool is even necessary for this.
      ================================

      There were some follow up discussions on this between Tom, Jerome and Scott in
      the email thread. I am filing this issue to track it.

      I will work with Jerome to discuss how to better utilize thread pool/thread in
      this case.

        Issue Links

          Activity

          Hide
          Hong Zhang added a comment -

          Discussed with Jerome: create an instance of ExecutorService in the
          deployment backend and pass it to the Parser through ParserContext so
          the same instance of the ExecutorServices will be used to process
          annotations for all deployments instead of re-creating the instance and shut it
          down each time.

          Show
          Hong Zhang added a comment - Discussed with Jerome: create an instance of ExecutorService in the deployment backend and pass it to the Parser through ParserContext so the same instance of the ExecutorServices will be used to process annotations for all deployments instead of re-creating the instance and shut it down each time.

            People

            • Assignee:
              Hong Zhang
              Reporter:
              Hong Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: