Bug 851234 - Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add()
Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add()
Status: NEW
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBoss Rules (Show other bugs)
5.3.0 GA
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Default User
:
Depends On:
Blocks: 852817
  Show dependency treegraph
 
Reported: 2012-08-23 10:38 EDT by Adam Kovari
Modified: 2015-08-31 23:04 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 852817 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3283 Minor Resolved Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add() 2015-11-26 03:32 EST

  None (edit)
Description Adam Kovari 2012-08-23 10:38:22 EDT
Description of problem:
Since Drools 5.3.0.CR1 concurrent creation of different knowledgebases from filesystem DRL rule definition leads to illegal bytecode.
Reproduceable with Janino and eclipse compiler.
I have a maven based test project which executes the unit tests in parallel, this is the result:
runFirst(de.trion.drools53.TwoTest): -1
  runFirst(de.trion.drools53.FourTest): (class: de/trion/drools53/Rule_When_a_user_is_young__print_his_name_DefaultConsequenceInvoker, method: equals signature: (Ljava/lang/Object;)Z) Expecting to find integer on stack
  runSecond(de.trion.drools53.FourTest): (class: de/trion/drools53/Rule_When_a_user_is_young__print_his_name_DefaultConsequenceInvoker, method: equals signature: (Ljava/lang/Object;)Z) Expecting to find integer on stack
  runFirst(de.trion.drools53.OneTest): (class: de/trion/drools53/Rule_When_a_user_is_young__print_his_name_DefaultConsequenceInvoker, method: equals signature: (Ljava/lang/Object;)Z) Expecting to find integer on stack
  runFirst(de.trion.drools53.ThreeTest): (class: de/trion/drools53/Rule_When_a_user_is_young__print_his_name_DefaultConsequenceInvoker, method: equals signature: (Ljava/lang/Object;)Z) Incompatible object argument for function call
  runSecond(de.trion.drools53.ThreeTest): (class: de/trion/drools53/Rule_When_there_is_god__the_light_always_shines_DefaultConsequenceInvoker, method: equals signature: (Ljava/lang/Object;)Z) Unable to pop operand off an empty stack
Workaround: synchronize access
Not affected: Drools 5.3.0.Beta


Version-Release number of selected component (if applicable):
JBoss SOA-P 5.3.0

How reproducible:
https://issues.jboss.org/browse/JBRULES-3283 contains testing project and description
Comment 1 Rick Wagner 2012-11-14 09:31:06 EST
This BZ will be resolved when we include Drools newer than 5.4 (per JBRULES-3283).
Comment 2 Shay Matasaro 2013-03-18 16:09:14 EDT
Customer has asked for a patch on 5.3 for this item, here is their issue description:

The other issue, JBRULES-3283, is actually more important. We're loading KnowledgeBuilders and KnowledgeBases on demand in various 'rule engine' components in the system (to minimize the memory footprint, '.drl' files which are not required/requested are not loaded). These engines can be accessed in parallel. Furthermore, we have one engine in which we load 71 ".drl" files in parallel into different KnowlegdeBuilders to speed up initialization. Due to JBRULES-3283 we manually need to synchronize every 'KnowledgeBuilder.add()' call using a common monitor, even though we're using different KnowlegdeBuilders. This 'workaround' is quite error-prone and when one forgets to apply it, can lead to non-deterministic problems in our rule engines.
Comment 3 Julian Coleman 2013-03-18 16:38:22 EDT
JBRULES-3283 was fixed in the version of Drools (5.3.1.BRMS-P01) released with SOA-P 5.3.1.GA.  Note, that JBRULES-3421 is not fixed in Drools 5.3.x.

Possible solutions to fix JBRULES-3283:
  upgrade to SOA-P 5.3.1.GA
  test Drools and jBPM jars from SOA-P 5.3.1 as patch to SOA-P 5.3.0.

Possible solution to fix JBRULES-3421:
  backport fix to Drools 5.3.x and include in BRMS-P 5.3.1 roll-up #1 (and SOA-P-5.3.1 roll-up #1)  [note, that inclusion in BRMS-P 5.3.1 needs to be decided very quickly]
Comment 5 Alessandro Lazarotti 2013-03-19 10:22:05 EDT
Julian, actually the "full" fix for JBRULES-3283 will be just in BRMS 5.3.1 Roll Up #1 - right? It is about our last comments on BUG 873846 - so if BRMS customer needs a fix about this, it will be there on Roll Up #1.

Note You need to log in before you can comment on or make changes to this bug.