hazelcast / hazelcast/hazelcast-cpp-client

[TRACKING ISSUE] Check nested fields of the Compact serializable objects are not serializable by other mechanisms in zero-config serialization

Open
#1,018 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
91
Forks
54
Avg merge
1d 12m
Merged PRs (30d)
5

Description

The tracking issue for the Java side PR.

See https://github.com/hazelcast/hazelcast/pull/22006 for details.

---

It could be the case that the top level class is serializable by
Compact, but it might have nested fields, which can also be serialized
by other mechanisms like Java serialization.

The problem is, that we cache the serializers, even the reflective
serializers. And, if we cache that we can serialize Java serializable
objects with Compact, this can be problematic for such scenarios

```
map.put(javaSerializable, 1)
map.put(zeroConfigSerializableWithJavaSerializableField, 2)
map.get(javaSerializable) // this returns null now, as the
// key was serialized with identified, but now it is Compact
```

To solve this, we check if the nested field is only be
serializable with Compact (either there is no other serialization
mechanism or Compact serializer is explicitly serialized with
it with `addClass` or `addSerializer`).

Closes https://github.com/hazelcast/hazelcast/issues/22004

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.