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

hazelcast 3.7.2 NullPointerException ClientPartitionServiceImpl$RefreshTaskCallback #9884

Closed
ssi-paulsideleau opened this issue Feb 13, 2017 · 3 comments

Comments

@ssi-paulsideleau
Copy link

@ssi-paulsideleau ssi-paulsideleau commented Feb 13, 2017

We are seeing intermittent null pointer exceptions in a background task coming from our hazelcast client using version 3.7.2.

ERROR com.hazelcast.client.spi.ClientInvocationService hz.client_0 [dev] [3.7.2] Failed asynchronous execution of execution callback: com.hazelcast.client.spi.impl.ClientPartitionServiceImpl$RefreshTaskCallback@28143d08for call ClientMessage{length=22, correlationId=200151, messageType=8, partitionId=-1, isComplete=true, isRetryable=false, isEvent=false, writeOffset=0} java.lang.NullPointerException: null
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
at com.hazelcast.client.spi.impl.ClientPartitionServiceImpl.processPartitionResponse(ClientPartitionServiceImpl.java:153)
at com.hazelcast.client.spi.impl.ClientPartitionServiceImpl.access$800(ClientPartitionServiceImpl.java:48)
at com.hazelcast.client.spi.impl.ClientPartitionServiceImpl$RefreshTaskCallback.onResponse(ClientPartitionServiceImpl.java:268)
at com.hazelcast.client.spi.impl.ClientPartitionServiceImpl$RefreshTaskCallback.onResponse(ClientPartitionServiceImpl.java:259)
at com.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)\n	at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)\n
@sancar sancar added this to the 3.8.1 milestone Feb 14, 2017
@sancar
Copy link
Member

@sancar sancar commented Feb 14, 2017

This issue is seen when client cannot resolve address that it gets from server. Probably because not able to connect to web temporarily.
when this InetAddress.getByName(host) throws UnknownHostException we end up with NullPointerException in our code.
I assume you set hostname instead of ip in your server hazelcast config. As a workaround you can try to set ip.
Getting null pointer exception does not cause any problem for your code as long as client is back to able to resolve the name, but we should update the code and print a friendly warning log instead of NullPointerException and StackTrace

@ssi-paulsideleau
Copy link
Author

@ssi-paulsideleau ssi-paulsideleau commented Feb 14, 2017

Thanks for your response. Yes, we are using hostnames in our server.config file. Thank you

@sancar sancar closed this Mar 14, 2017
@sancar
Copy link
Member

@sancar sancar commented Apr 10, 2017

Reopened to handle InetAddress.getByName(host) throws UnknownHostException correctly instead of suggesting workaround.

@sancar sancar reopened this Apr 10, 2017
@sancar sancar modified the milestones: 3.8.2, 3.8.1 Apr 10, 2017
@sancar sancar self-assigned this Apr 10, 2017
@sancar sancar added Team: Core and removed Team: Core labels Apr 14, 2017
@sancar sancar assigned sancar and unassigned sancar Apr 17, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Apr 28, 2017
AddressCodec is used to catch UnkownHostException and return null.
With new hazelcast-client-protocol.jar, it sends exception wrapped
up to HazelcastException.

In authentication response, HazelcastException is catched to fail
correctly.

fixes hazelcast#9884
sancar added a commit to sancar/hazelcast that referenced this issue Apr 28, 2017
AddressCodec is used to catch UnkownHostException and return null.
With new hazelcast-client-protocol.jar, it sends exception wrapped
up to HazelcastException.

In authentication response, HazelcastException is catched to fail
correctly.

fixes hazelcast#9884
sancar added a commit to sancar/hazelcast that referenced this issue Apr 28, 2017
AddressCodec is used to catch UnkownHostException and return null.
With new hazelcast-client-protocol.jar, it sends exception wrapped
up to HazelcastException.

In authentication response, HazelcastException is catched to fail
correctly.

fixes hazelcast#9884
sancar added a commit to sancar/hazelcast that referenced this issue Apr 28, 2017
AddressCodec is used to catch UnkownHostException and return null.
With new hazelcast-client-protocol.jar, it sends exception wrapped
up to HazelcastException.

In authentication response, HazelcastException is catched to fail
correctly.

fixes hazelcast#9884
sancar added a commit to sancar/hazelcast that referenced this issue Apr 28, 2017
AddressCodec is used to catch UnkownHostException and return null.
With new hazelcast-client-protocol.jar, it sends exception wrapped
up to HazelcastException.

In authentication response, HazelcastException is catched to fail
correctly.

fixes hazelcast#9884
@sancar sancar closed this in #10458 May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants