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

NullPointerException in LockServiceImpl #9792

Donnerbart opened this issue Feb 1, 2017 · 1 comment


None yet
1 participant
Copy link

commented Feb 1, 2017

We can produce a NPE in LockServiceImpl by creating one map with a quorum configuration (which activates the QuorumServiceImpl for all QuorumAware operations) and then call an QuorumAware operation on another data structure without a quorum configuration:

	at java.util.concurrent.ConcurrentHashMap.putVal(
	at java.util.concurrent.ConcurrentHashMap.put(
	at com.hazelcast.util.ConcurrencyUtil.getOrPutSynchronized(
	at com.hazelcast.concurrent.lock.LockServiceImpl.getQuorumName(
	at com.hazelcast.quorum.impl.QuorumServiceImpl.findQuorum(
	at com.hazelcast.quorum.impl.QuorumServiceImpl.ensureQuorumPresent(
	at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.ensureQuorumPresent(
	at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(
	at ------ submitted from ------.(Unknown Source)
	at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.resolve(
	at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.resolveAndThrowIfException(
	at com.hazelcast.spi.impl.AbstractInvocationFuture.get(
	at com.hazelcast.spi.impl.AbstractInvocationFuture.join(
	at com.hazelcast.concurrent.lock.LockProxySupport.unlock(
	at com.hazelcast.concurrent.lock.LockProxy.unlock(
	at com.hazelcast.quorum.QuorumTest.oneQuorumShouldNotAffectQuorumAwareOperationsOnDataStructuresWithoutQuorumConfiguration(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at com.hazelcast.test.FailOnTimeoutStatement$
	at com.hazelcast.test.FailOnTimeoutStatement$

The reason is the LockConfig lockConfig = nodeEngine.getConfig().findLockConfig(name) which returns the default configuration for non-quorum data structures, which has null as quorum name. This null is then put into the ConcurrentMap<String, String> quorumConfigCache which produces the NPE.

@Donnerbart Donnerbart added this to the 3.8 milestone Feb 1, 2017

@Donnerbart Donnerbart self-assigned this Feb 1, 2017


This comment has been minimized.

Copy link
Contributor Author

commented Feb 1, 2017

Fixed via 98c61b1 (sorry, forget to create a branch for a PR)

@Donnerbart Donnerbart closed this Feb 1, 2017

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.