#26454·hazelcast

HazelcastCache.getAsync() timeout issue in Hazelcast Client

Author: PPakSangCreated Nov 1, 2024Updated Jun 20, 2026
LabelsType: DefectTeam: ClientSource: Community

Describe the bug

We are using Hazelcast 5.3.6 and Hazelcast Client 5.3.6.

When I attempt to retrieve cached data asynchronously using HazelcastCache.getAsync() (where the data has a read timeout of 3 seconds), I encounter an issue.

The bug occurs when a non-serializable Java object is stored in Hazelcast and then accessed from another application (which has the same object class). Hazelcast processes the job asynchronously, presumably in a separate thread, though I'm not entirely sure how it works internally.

If the processing time exceeds the timeout limit, CompletableFuture does not return a result. Instead, the Hazelcast client disconnects from Hazelcast due to a heartbeat timeout while the process remains blocked. I'm not sure why this happens.

After the Hazelcast client reconnects, this issue no longer occurs. However, it can reappear if the application is restarted.

image image image

Expected behavior If the same class is used (meaning the file is unchanged), the stored object in Hazelcast should be deserialized in the other application (which has the same object class). Alternatively, getAsync() should immediately throw an exception if a SerializationException or TimeoutException occurs.

I understand this issue does not occur if the object implements Serializable. However, is there a way to handle this scenario without implementing Serializable?(i found compact serialization but it describes you can use zero-configuraiton if you use java)

To Reproduce

Steps to reproduce the behavior:

  1. store object without Seiralizable(using hazelcast-client)
image
  1. restart application

  2. get(using getAsync) it from hazelcast

  3. getAsync timeout doesn't work and HazelcastClientOfflineException occur after connection timeout