Skip to content

Conversation

@mxm
Copy link
Contributor

@mxm mxm commented Mar 26, 2025

KryoSerializer loads FlinkScalaKryoInstantiator via Reflection which configures Kryo to use StdInstantiatorStrategy. After FLINK-3154 removed the Twitter Chill library, various types are broken. See EsotericSoftware/kryo#1173

At first, it seemed that the Kryo update caused this but I can reproduce this also with Kryo 2.24.0 with the Chill library removed.

This change matches the default strategy when the Scala serializers are unavailable: https://github.com/apache/flink/blob/f7a53cede10fa25cb025d5554126a83773ba6bf9/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java#L496

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 26, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@davidradl
Copy link
Contributor

@mxm there are numerous table planner test failures in the CI tests.

Copy link
Contributor

@davidradl davidradl left a comment

Choose a reason for hiding this comment

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

Please could you provide a unit test for this change.
Also the CI is failing - on the face of it due to this change.

@mxm
Copy link
Contributor Author

mxm commented Apr 3, 2025

Thanks for the review @davidradl!

I briefly looked into adding a test but it proofed a bit difficult due to zero tests for the Scala serializer extensions. The test would have to go into the Scala module or the e2e test module. It isn't possible to test this from flink-core where KryoSerializer resides because the code is dynamically loaded from the table api scala module.

I'm OoO currently but I'll take a look next week.

@michaelparkin
Copy link

Hi @mxm , @davidradl - is there any update on this PR?

We're experiencing the same problem and it would be great to have this in flink 2.0.1. Thanks.

@mxm
Copy link
Contributor Author

mxm commented Jun 30, 2025

Hey @michaelparkin! Could you share more details about your use case? When do you run into the serialization issue?

@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed component=API/TypeSerializationSystem community-reviewed PR has been reviewed by the community. labels Jun 30, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Jul 17, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Jul 22, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Aug 12, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Aug 26, 2025
@github-actions github-actions bot added community-reviewed PR has been reviewed by the community. and removed community-reviewed PR has been reviewed by the community. labels Sep 5, 2025
@neoneo008
Copy link

Hi @mxm @davidradl , any update on the PR.

We are facing similar issue with Mongodb connectors where we get null pointer since the constructor is not called by kyro. PR which has failure in build logs. apache/flink-connector-mongodb#57

Happy to help on this PR if anything is pending.

…ntiator

KryoSerializer loads FlinkScalaKryoInstantiator via Reflection which configures Kryo to use
StdInstantiatorStrategy. After FLINK-3154 removed the Twitter Chill library, various types are
broken. See EsotericSoftware/kryo#1173

At first, it seemed that the Kryo update caused this but I can reproduce this also with Kryo 2.24.0
with the Chill library removed.

This change matches the default strategy when the Scala serializers are unavailable:
https://github.com/apache/flink/blob/f7a53cede10fa25cb025d5554126a83773ba6bf9/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java#L496
@mxm
Copy link
Contributor Author

mxm commented Nov 24, 2025

I think we need to fix some of the custom Scala serializers after this change. The current serializer configuration relies on the default strategy to be StdInstantiatorStrategy, which we changed here. I'm going to rebase and revisit this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants