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

Threadpools never shrink back to min-threads

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Commons Threads 3.2.22
    • None
    • Commons
    • None

    Description

      I made the observation that threadpools with an unbounded queue (default) which are managed by Sling Threadpools never shrink to the configured minimum of threads, but consistently have all threads running, even if no work needs to be done:

      Output of the Webconsole Printer
      Pool ThreadPool-7cfefa0b-49bc-402f-aaca-2e5b2a21b986 
      - used : true
      - min pool size : 5
      - max pool size : 10
      - queue size : -1
      - keep alive time : 60000
      - block policy : RUN
      - priority : NORM
      - shutdown graceful : true
      - shutdown wait time : -1
      - daemon : false
      - active count : 0
      - completed task count : 0
      - core pool size : 10
      - largest pool size : 0
      - maximum pool size : 10
      - pool size : 0
      - task count : 0
      

      Here the "min pool size" is set to 5, but the Core Pool Size of the JDK's ThreadPoolExecutor is set to 10.

      This seems to be caused by SLING-7407 (Github).

      We should improve that so that the CorePoolSize of the ThreadPoolExecutor is actually set to the configured min value, even if the queue is unbounded. This allows the threadpool to properly downscale if the threads are not needed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              joerghoh Joerg Hoh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: