Skip to content

Conversation

mdumandag
Copy link
Contributor

We were performing lazy deserialization on APIs that return a list of data, such as map#values(). This was not going to work with Compact, as after returning the list to the user, there might be Compact serialized data on the list which we don't have the schema on the client yet. If it was a normal response, the client would have fetched the schema, but it is not possible with these lazy APIs. We perform the deserialization while getting the list items and this is a sync API. We can't perform a blocking call there, because there is a chance that this will be executed in the reactor thread, which would result in a deadlock.

So, the only possible way of making these APIs work with Compact is to convert them to eager deserialization.

This PR removes lazy deserialization in everything apart from SQL, which will be handled in another PR.

We were performing lazy deserialization on APIs that return
a list of data, such  as map#values(). This was not going to work
with Compact, as after returning the list to the user, there might
be Compact serialized data on the list which we don't have the
schema on the client yet. If it was a normal response, the client
would have fetched the schema, but it is not possible with
these lazy APIs. We perform the deserialization while getting
the list items and this is a sync API. We can't perform a blocking
call there, because there is a chance that this will be executed
in the reactor thread, which would result in a deadlock.

So, the only possible way of making these APIs work with Compact
is to convert them to eager deserialization.

This PR removes lazy deserialization in everything apart from SQL,
which will be handled in another PR.
@mdumandag mdumandag added this to the 5.2.0 milestone Mar 20, 2023
@mdumandag mdumandag requested a review from yuce March 20, 2023 07:43
@mdumandag mdumandag self-assigned this Mar 20, 2023
Copy link
Contributor

@yuce yuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor idea...

return version


def deserialize_list_in_place(data_list, to_object_fn):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be type annotation for the new functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, I wish we fully type hint the code base so that we can add checks for such things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2023

Codecov Report

Attention: Patch coverage is 97.24771% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.49%. Comparing base (b728a54) to head (c8ff71b).
Report is 78 commits behind head on master.

Files with missing lines Patch % Lines
hazelcast/proxy/ringbuffer.py 87.50% 2 Missing ⚠️
hazelcast/util.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #618   +/-   ##
=======================================
  Coverage   96.48%   96.49%           
=======================================
  Files         357      357           
  Lines       20519    20554   +35     
=======================================
+ Hits        19798    19833   +35     
  Misses        721      721           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mdumandag mdumandag merged commit cd9a317 into hazelcast:master Mar 23, 2023
@mdumandag mdumandag deleted the compact-lazy-apis branch March 23, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants