Bug 851234 - Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add()
Summary: Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add()
Keywords:
Status: NEW
Alias: None
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBoss Rules
Version: 5.3.0 GA
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 852817
TreeView+ depends on / blocked
 
Reported: 2012-08-23 14:38 UTC by Adam Kovari
Modified: 2021-05-04 07:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 852817 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3283 0 Minor Resolved Concurrency issue: Invalid bytecode generated by KnowledgeBuilder.add() 2018-10-02 23:52:37 UTC

Description Adam Kovari 2012-08-23 14:38:22 UTC
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 14:31:06 UTC
This BZ will be resolved when we include Drools newer than 5.4 (per JBRULES-3283).

Comment 2 Shay Matasaro 2013-03-18 20:09:14 UTC
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 20:38:22 UTC
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 14:22:05 UTC
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.