Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7211

Drools worker threads are not cleaned up on tomcat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • None
    • 7.58.0.Final, 7.66.0.Final
    • core engine
    • None
    • 2022 Week 44-46 (from Oct 31)
    • Hide
      1. Deploy webapplication with non trivial knowledgebase on tomcat (tested on 7.0.64)
      2. Call application, create DroolsSession and execute Rules (tested with drools 7.58 & 7.66)
      3. "drools-worker" threads are created
      4. Undeploy application / shutdown
      5. Tomcat logs that threads were not removed
      6. "Visual VM" confirms that threads were not removed
      Show
      Deploy webapplication with non trivial knowledgebase on tomcat (tested on 7.0.64) Call application, create DroolsSession and execute Rules (tested with drools 7.58 & 7.66) "drools-worker" threads are created Undeploy application / shutdown Tomcat logs that threads were not removed "Visual VM" confirms that threads were not removed
    • NEW
    • NEW
    • ---
    • ---

      This Issue seems to be very similar to DROOL-1156. Unfortunatly the implemented solution seems not to work on a tomcat application server as there is no managed executor service.

      It seems that the deployed knowledgebase need at least some level complexity as trivial examples do not run in this behaviour. If my debugging was correct it seems that this is related drools internal optimization, which would explain that simple knowledgebases will not be optimized.

      The log that the tomcat emits for each left over thread looks like that:

      WARNING [Thread-3] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xxx] appears to have started a thread named [drools-worker-3] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: 

      As we usually only see this message when we shutdown the server this memory leak issue is not that severe for our usecase, it is still anoying and causes confusion for our customer. Therefore we would be happy if they would not appear.

            mfusco@redhat.com Mario Fusco
            cmartensen Christian Martensen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: