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

bugfix: kryo support circular reference #4978

Merged
merged 5 commits into from
Oct 9, 2022
Merged

Conversation

JavaLionLi
Copy link
Contributor

@JavaLionLi JavaLionLi commented Oct 8, 2022

这是给dubbo提交pr的过程中遇到的问题 如下是kryo的官方回复
EsotericSoftware/kryo#919

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@JavaLionLi JavaLionLi changed the title fix 修复 5.X 循环引用被默认设置为 false 导致栈溢出问题 fix 修复 kryo 5.X 循环引用被默认设置为 false 导致栈溢出问题 Oct 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2022

Codecov Report

Merging #4978 (30038c8) into develop (1cbc19c) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4978      +/-   ##
=============================================
+ Coverage      48.77%   48.79%   +0.02%     
- Complexity      4078     4081       +3     
=============================================
  Files            734      734              
  Lines          25853    25854       +1     
  Branches        3190     3190              
=============================================
+ Hits           12609    12616       +7     
+ Misses         11901    11898       -3     
+ Partials        1343     1340       -3     
Impacted Files Coverage Δ
...o/seata/serializer/kryo/KryoSerializerFactory.java 91.30% <100.00%> (+0.39%) ⬆️
...very/registry/zk/ZookeeperRegisterServiceImpl.java 61.02% <0.00%> (-0.74%) ⬇️
...erver/storage/file/session/FileSessionManager.java 47.77% <0.00%> (-0.64%) ⬇️
...rage/redis/store/RedisTransactionStoreManager.java 67.52% <0.00%> (+1.42%) ⬆️
...n/src/main/java/io/seata/common/util/IdWorker.java 83.33% <0.00%> (+6.25%) ⬆️

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM 标题改为英文标题 bugfix: xxxx,尽量简洁,并且再进行pr信息登记

@JavaLionLi JavaLionLi changed the title fix 修复 kryo 5.X 循环引用被默认设置为 false 导致栈溢出问题 bugfix: kryo 5.X 循环引用默认设置为 false 导致栈溢出问题 Oct 8, 2022
@JavaLionLi
Copy link
Contributor Author

LGTM 标题改为英文标题 bugfix: xxxx,尽量简洁,并且再进行pr信息登记

complete

@funky-eyes funky-eyes changed the title bugfix: kryo 5.X 循环引用默认设置为 false 导致栈溢出问题 bugfix: kryo support circular reference Oct 8, 2022
@funky-eyes
Copy link
Contributor

你看下我这样改的标题是否正确,如果可以就把登记的pr信息重新改一下,言简意赅

@JavaLionLi
Copy link
Contributor Author

你看下我这样改的标题是否正确,如果可以就把登记的pr信息重新改一下,言简意赅

已更改

@funky-eyes funky-eyes added this to the 1.6.0 milestone Oct 8, 2022
@jsbxyyx
Copy link
Member

jsbxyyx commented Oct 8, 2022

@JavaLionLi rm-datasource KryoSerializerFactory fix too.

@@ -48,6 +48,7 @@ public class KryoSerializerFactory {
@Override
protected Kryo create() {
Kryo kryo = new Kryo();
kryo.setReferences(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

I m wondering that why kryo 4 the property of references is true, and kryo 5 is false. What is the reason for example like lower performance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you present a small test report?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you present a small test report?

This is not very clear
The kryo community didn't explain why

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you present a small test report?

If not set, the stack will overflow
The scheme given by the community is set to true

Copy link
Contributor

@l81893521 l81893521 Oct 8, 2022

Choose a reason for hiding this comment

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

If not set, the stack will overflow The scheme given by the community is set to true

yes, the stack will overflow. But this problem look like never happen in seata, because the object from database it can not with cycle, so why I m wonder the performance if set it true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If not set, the stack will overflow The scheme given by the community is set to true

yes, the stack will overflow. But this problem look like never happen in seata, because the object from database it can not with cycle, so why I m wonder the performance if set it true.

EsotericSoftware/kryo#617
If complex objects are not involved, it is best not to enable them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If not set, the stack will overflow The scheme given by the community is set to true

yes, the stack will overflow. But this problem look like never happen in seata, because the object from database it can not with cycle, so why I m wonder the performance if set it true.

EsotericSoftware/kryo#617 If complex objects are not involved, it is best not to enable them

  1. X is enabled by default, and it needs to be tested whether it will have an impact after being closed

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. X is enabled by default, and it needs to be tested whether it will have an impact after being closed

ok

@JavaLionLi
Copy link
Contributor Author

JavaLionLi commented Oct 8, 2022

@JavaLionLi rm-datasource KryoSerializerFactory fix too.

Fixed

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@l81893521 l81893521 left a comment

Choose a reason for hiding this comment

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

LGTM

@l81893521 l81893521 merged commit f300ca6 into apache:develop Oct 9, 2022
@funky-eyes
Copy link
Contributor

麻烦请签署Seata社区的cla协议感谢配合 https://cla-assistant.io/seata/seata?pullRequest=5164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants