Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7407

A thread pool with min size 1 uses only 1 thread for processing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Commons Threads 3.2.16
    • Commons
    • None

    Description

      If a thread pool is configured like below

       org.apache.sling.commons.threads.impl.DefaultThreadPool.factory-oak
          name="oak"
          minPoolSize=I"1"
          maxPoolSize=I"5"
      

      Then only 1 thread would be used even if multiple jobs are assigned to the pool. This happens because of strange behaviour of Java ThreadPoolExecutor

      If there are more than corePoolSize but less than maximumPoolSize threads running, a new thread will be created only if the queue is full

      With unbounded queue used this lead to current behaviour. As a fix Sling Thread Pool should adapt such a config

      Attachments

        Issue Links

          Activity

            People

              stefanegli Stefan Egli
              chetanm Chetan Mehrotra
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: