Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16178

ZkController#fireEventListeners thread should be shutdown on close

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      ZkController#fireEventListeners creates a new thread but it is not stopped or interrupted on shutdown. This leaks threads.

      I started looking into this because of TestBulkSchemaConcurrent and leaking threads:

         1) Thread[id=20840, name=ZKEventListenerThread, state=TIMED_WAITING, group=TGRP-TestBulkSchemaConcurrent]
              at java.base@17.0.2/java.lang.Thread.sleep(Native Method)
              at app//org.apache.solr.common.cloud.ZkCmdExecutor.retryDelay(ZkCmdExecutor.java:161)
              at app//org.apache.solr.common.cloud.ZkCmdExecutor.retryOperation(ZkCmdExecutor.java:82)
              at app//org.apache.solr.common.cloud.SolrZkClient.exists(SolrZkClient.java:318)
              at app//org.apache.solr.cloud.ZkController.setConfWatcher(ZkController.java:2777)
              at app//org.apache.solr.cloud.ZkController.getConfDirListeners(ZkController.java:2699)
              at app//org.apache.solr.cloud.ZkController.registerConfListenerForCore(ZkController.java:2679)
              at app//org.apache.solr.core.SolrCore.registerConfListener(SolrCore.java:3345)
              at app//org.apache.solr.core.SolrCore.<init>(SolrCore.java:1183)
              at app//org.apache.solr.core.SolrCore.reload(SolrCore.java:780)
              at app//org.apache.solr.core.CoreContainer.reload(CoreContainer.java:1857)
              at app//org.apache.solr.core.SolrCore.lambda$getConfListener$21(SolrCore.java:3394)
              at app//org.apache.solr.core.SolrCore$$Lambda$926/0x0000000801430b18.run(Unknown Source)
              at app//org.apache.solr.cloud.ZkController.lambda$fireEventListeners$18(ZkController.java:2762)
              at app//org.apache.solr.cloud.ZkController$$Lambda$1401/0x0000000801768770.run(Unknown Source)
              at java.base@17.0.2/java.lang.Thread.run(Thread.java:833)
      

      It turns out this thread leak happens a lot: https://lists.apache.org/list?builds@solr.apache.org:lte=1M:%22fireEventListeners%22

      Attachments

        Issue Links

          Activity

            People

              krisden Kevin Risden
              krisden Kevin Risden
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m