martinweiler opened a new pull request, #7285:
URL: https://github.com/apache/incubator-kie/pull/7285

   Closes https://github.com/apache/incubator-kie/issues/7284
   
   `JoinInstance.existsActiveDirectFlow` decides whether an inclusive (OR) join 
has to wait. It checks whether any other active node instance can still reach 
the join. In two situations it wrongly answers "no", so the join fires while a 
branch is still active.
   
   **Cause 1: consecutive XOR splits (`checkNodes`)**
   - In the XOR-split branch, `checkNodes` recursed with `currentNode` as 
`startAt`.
   - A directly following XOR split then hit `if 
(vistedNodes.contains(startAt.getId())) return false`. That cut off the whole 
path to the join.
   - **Fix**: pass `startAt` instead of `currentNode`.
   
   **Cause 2: loop level filter (`existsActiveDirectFlow`)**
   - The method skipped every active node instance whose `getLevel()` differs 
from the join's level.
   - After a loop has run twice, the active task of the second iteration is at 
a higher level. It is skipped even though it still leads to the join.
   - **Fix**: skip a node of another level only if it is in a loop through the 
join, or in no loop at all (timers or multi-instance passing the join 
independently). Otherwise it still counts.
   - `-Djbpm.loop.level.disabled=true` hides the symptom but disables level 
separation JVM-wide. It is not an equivalent fix.
   
   **Junit tests added**:
   1. **`testInclusiveJoinWaitsForLoopWithChainedXorSplits`**: checks that the 
inclusive join waits for a branch whose loop contains two consecutive XOR 
splits, instead of firing when the other branch completes.
   2. **`testInclusiveJoinWaitsForActiveNodeOfLaterLoopIteration`**: checks 
that the inclusive join waits for a task from a later loop iteration (a higher 
loop level) that is still active when the parallel branch arrives at the join.
   3. **`testInclusiveJoinWithCycleOfDirectlyConnectedXorSplits`**: checks that 
the join's reachability check terminates, and the join still waits, when two 
XOR splits form a cycle with no task between them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to