Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in PartitionWideEntryWithPredicateOperationFactory #8622

Closed
Donnerbart opened this issue Jul 29, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@Donnerbart
Copy link
Contributor

commented Jul 29, 2016

There is a possible regression in the PartitionAwareOperationFactory related code. I found it when I tried to increase the missing code coverage of MultipleEntryWithPredicateOperation (which is not serialized/deserialized in any test yet).

The only way to invoke this operation remotely seems to be a bouncing member test, otherwise it is always executed locally by the operation factory. So I modified the EntryProcessorBouncingNodesTest (which enforces migrations) to use a predicate. I had to trick a bit with index creation and usage to jump into the right code paths, but eventually it worked out. Here is the test code: https://gist.github.com/Donnerbart/797d38b956ad6e72a9c293c935400600#file-entryprocessorbouncingnodestest-java

The test was green but the serialization was not triggered. Maybe dead code? Then I parked that task about a month ago. In the meantime we changed the IMap.putAll() business logic to use the PartitionAwareOperationFactory, since it was not working correctly in a bouncing member scenario. We had to change a tiny bit of code in InvokeOnPartitions to get it running: https://github.com/hazelcast/hazelcast/pull/8310/files#diff-6e74e701782f4c49c2205f95820abe25R127 (also see the discussion about this here #8310 (comment))

When I run my modified EntryProcessorBouncingNodesTest, this change results in a NPE now:

java.lang.NullPointerException: list cannot be null

    at com.hazelcast.util.Preconditions.checkNotNull(Preconditions.java:59)
    at com.hazelcast.util.collection.InflatableSet$Builder.<init>(InflatableSet.java:262)
    at com.hazelcast.util.collection.InflatableSet$Builder.<init>(InflatableSet.java:254)
    at com.hazelcast.util.collection.InflatableSet.newBuilder(InflatableSet.java:104)
    at com.hazelcast.map.impl.operation.PartitionWideEntryWithPredicateOperationFactory.createPartitionOperation(PartitionWideEntryWithPredicateOperationFactory.java:109)
    at com.hazelcast.spi.impl.operationservice.impl.InvokeOnPartitions.retryFailedPartitions(InvokeOnPartitions.java:128)
    at com.hazelcast.spi.impl.operationservice.impl.InvokeOnPartitions.invoke(InvokeOnPartitions.java:70)
    at com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl.invokeOnAllPartitions(OperationServiceImpl.java:359)
    at com.hazelcast.map.impl.proxy.MapProxySupport.executeOnEntriesInternal(MapProxySupport.java:1051)
    at com.hazelcast.map.impl.proxy.MapProxyImpl.executeOnEntriesInternal(MapProxyImpl.java:82)
    at com.hazelcast.map.impl.proxy.MapProxyImpl.executeOnEntries(MapProxyImpl.java:730)
    at com.hazelcast.map.EntryProcessorBouncingNodesTest.testEntryProcessorWhileTwoNodesAreBouncing(EntryProcessorBouncingNodesTest.java:130)
    at com.hazelcast.map.EntryProcessorBouncingNodesTest.testEntryProcessorWhileTwoNodesAreBouncing_withPredicate(EntryProcessorBouncingNodesTest.java:90)

When I revert InvokeOnPartitions to Operation operation = operationFactory.createOperation(); the test is running fine again. So we seem to break either the Index Support for Entry Processor or the IMap.putAll() logic right now, assuming that my test is not doing any stupid things.

I also could not trigger the serialization logic of MultipleEntryWithPredicateOperation, so I still don't know if this is dead code or not.

@jerrinot @ahmetmircik Could you please have a look if I wrote a stupid test or if this is a real regression?

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2016

fixed by #8627

@jerrinot jerrinot closed this Aug 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.