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

2nd incremental update causes misfiring of a rule with 'from'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.58.0.Final
    • 7.57.0.Final
    • kie server
    • None
    • 2021 Week 28-30 (from Jul 12)
    • 5
    • Hide
      • Import the "productList" project via unzipped 02983362-reproducer
      • Deploy to kie-server
      • Execute send-request.sh (changed only user/password)
        -> returns the correct response
      • Go to "Data Object" editor for "productList"
      • Remove "orders" field
      • Press "Save"
      • Deploy to kie-server
      • Execute send-request.sh again
        -> returns the correct response
      • Add "orders" field as String[List]
      • Press "Save"
      • Deploy to kie-server
      • Execute send-request.sh again
        -> returns the score = null response (It means that rules are not fired)
      Show
      Import the "productList" project via unzipped 02983362-reproducer Deploy to kie-server Execute send-request.sh (changed only user/password) -> returns the correct response Go to "Data Object" editor for "productList" Remove "orders" field Press "Save" Deploy to kie-server Execute send-request.sh again -> returns the correct response Add "orders" field as String [List] Press "Save" Deploy to kie-server Execute send-request.sh again -> returns the score = null response (It means that rules are not fired)
    • Workaround Exists
    • Hide

      Undeploy/deploy project makes it work as expected

      Show
      Undeploy/deploy project makes it work as expected
    • Undefined
    • NEW
    • NEW

      On the 3rd run (= 2nd incremental update), FromNode.resultClass's ClassLoader is old so the list element objects don't match the resultClass.

      Why this happens on the 3rd run? Because

      • The 1st run : KnowledgePackageImpl doesn't have typeResolver.
      • The 2nd run : KieBaseUpdaterImpl lets KnowledgePackageImpl create a ClassTypeResolver which caches classes in cachedImports.
      • The 3rd run : KieBaseUpdaterImpl reuses the KnowledgeBaseImpl, KnowledgePackageImpl and the ClassTypeResolver.

      TypeResolver.cachedImports may return a Class with an old ClassLoader but KieBaseUpdaterImpl calls kbuilder.rewireAllClassObjectTypes() to solve the classloader mismatch. The problem is that FromNode holds resultClass as a bare Class object which is not reached by wiring.

            rhn-support-tkobayas Toshiya Kobayashi
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: