Rikkola opened a new pull request, #7159:
URL: https://github.com/apache/incubator-kie/pull/7159
TupleSetsImpl.removeInsert, removeDelete and removeUpdate all reached the
else-branch (tuple is not the list head) and called setNextTuple(previous,
next) without guarding previous != null.
setNextTuple dereferences its first argument unconditionally:
tuple.setStagedNext(stagedNext)
So when previous is null the call NPEs with:
NullPointerException: Cannot invoke TupleImpl.setStagedNext(TupleImpl)
because 'tuple' is null
This surfaces in doSubnetwork2 when a subnetwork CE is shared by a not() and
an exists() (one TupleToObjectNode feeds two beta nodes). A delete-staged
SubnetworkTuple whose getStagedTypeOnRight() reports INSERT causes removeInsert
to be called via moveStagingFromLeftToRight(). If the tuple's left staging
previous link is null because the right-staging diverged from left-staging (the
tuple was processed as first-in-list by a sibling node path and its previous
link was cleared), setNextTuple NPEs.
Fix: guard all three callers with if (previous != null) — exactly the same
shape as the existing next != null guard on the sibling setPrevoiusTuple call.
removeDelete and removeUpdate contained the identical unguarded line; fix
all three for consistency, matching the suggested fix in the issue.
Adds
SubnetworkTest.sharedSubnetworkNotAndExistsDoesNotNpeOnConcurrentStagedDelete
which creates the shared-subnetwork topology (not + exists wrapping identical
CE) with multiple concurrent InputFact tuples and insertLogical/retract cycling
to exercise the delete path.
Fixes apache/incubator-kie-issues#7121
--
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]