Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-223

PathChildrenCache (wastefully) creates a thread per monitored node.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.1
    • 2.9.0
    • Recipes
    • None

    Description

      PathChildrenCache creates a single-threaded executor. In the aggregate, this means there is a thread for every monitored node.

      In my company's use case, we use ServiceCache (which uses PathChildrenCache) to monitor service discovery nodes for the locations of many sharded immutable key/value stores used by our services. We saw in excess of 250 threads devoted to the PathChildrenCache's used by ServiceCache. These threads were all parked so there was negligible CPU impact, but there is still the memory/stack impact of having so many idle threads. We would like to avoid that impact.

      I'd like to modify PathChildrenCache to take an ExecutorService as an alternate to the ThreadFactory it currently takes. This would allow me to pass in a thread pool for my company's use case.

      Are there any issues with which I should be concerned concerning PathChildrenCache's use of separate threads? (Non-reentrancy from watcher-invoked code? Binary compatibility?)

      Attachments

        Activity

          People

            randgalt Jordan Zimmerman
            tdyas Tom Dyas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: