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

[Dubbo-4861] WIP: fix stackoverflow of protostuff and other errors #4862

Merged
merged 2 commits into from
Aug 22, 2019

Conversation

Moriadry-zz
Copy link

@Moriadry-zz Moriadry-zz commented Aug 17, 2019

What is the purpose of the change

And a test case and fix #4861

Brief changelog

XXXXX

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@Moriadry-zz Moriadry-zz changed the title fix stackoverflow of protostuff and other errors Fix [4861] fix stackoverflow of protostuff and other errors Aug 17, 2019
@Moriadry-zz Moriadry-zz changed the title Fix [4861] fix stackoverflow of protostuff and other errors [Dubbo-4861] fix stackoverflow of protostuff and other errors Aug 17, 2019
@tswstarplanet
Copy link
Contributor

#3252 your pr and this pr are opposite. I think the two prs are both not the solutions. We should find better solutions.

@tswstarplanet
Copy link
Contributor

I think it's a problem of Protostuff project, it should provide a unified util class to process either loop-reference object or non-loop-reference object.

@Moriadry-zz
Copy link
Author

yes, I also find this problem.

It seems there are something wired about the ProtostuffObjectOutput implement, with this object used, It will cause an endless loop. I will spend more time digging into it.

@Moriadry-zz Moriadry-zz changed the title [Dubbo-4861] fix stackoverflow of protostuff and other errors [Dubbo-4861] WIP: fix stackoverflow of protostuff and other errors Aug 17, 2019
@Moriadry-zz
Copy link
Author

@tswstarplanet When I use protostuff directly, There are no endless loop shown up. Maybe this is not the problem of Protostuff?

@tswstarplanet
Copy link
Contributor

tswstarplanet commented Aug 17, 2019

@moriadry Good! You can optimize the class

@codecov-io
Copy link

Codecov Report

Merging #4862 into master will decrease coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4862      +/-   ##
============================================
- Coverage     64.01%   63.89%   -0.13%     
+ Complexity      453      450       -3     
============================================
  Files           769      769              
  Lines         33177    33177              
  Branches       5229     5229              
============================================
- Hits          21239    21199      -40     
- Misses         9516     9556      +40     
  Partials       2422     2422
Impacted Files Coverage Δ Complexity Δ
.../apache/dubbo/qos/protocol/QosProtocolWrapper.java 65.85% <0%> (-17.08%) 0% <0%> (ø)
.../remoting/transport/netty4/NettyServerHandler.java 61.9% <0%> (-9.53%) 0% <0%> (ø)
...ng/transport/dispatcher/all/AllChannelHandler.java 51.42% <0%> (-5.72%) 0% <0%> (ø)
.../org/apache/dubbo/remoting/ExecutionException.java 15.78% <0%> (-5.27%) 0% <0%> (ø)
...onfig/spring/extension/SpringExtensionFactory.java 80.48% <0%> (-4.88%) 0% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 61.17% <0%> (-4.71%) 0% <0%> (ø)
...e/dubbo/remoting/transport/netty/NettyChannel.java 57.64% <0%> (-4.71%) 20% <0%> (-1%)
.../apache/dubbo/remoting/transport/AbstractPeer.java 58.69% <0%> (-4.35%) 0% <0%> (ø)
...he/dubbo/remoting/transport/netty/NettyServer.java 69.64% <0%> (-3.58%) 8% <0%> (-1%)
...exchange/support/header/HeaderExchangeHandler.java 64.75% <0%> (-2.46%) 0% <0%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10ef042...7651e3a. Read the comment docs.

@beiwei30
Copy link
Member

I am a little bit confused, @moriadry. What this pull request does is to add more tests, is it sufficient?

@Moriadry-zz
Copy link
Author

@beiwei30 I caught stackoverflow error when I add two unit tests. And it turns out the Inner class need a static declaration , otherwise It will show us SOF error. The current implement of Protostuff project is correct.

Do you think we need to add those two tests in ProtostuffObjectOutputTest.java? If not so, I will close pr and issue.

@beiwei30
Copy link
Member

@beiwei30 I caught stackoverflow error when I add two unit tests. And it turns out the Inner class need a static declaration , otherwise It will show us SOF error. The current implement of Protostuff project is correct.

Do you think we need to add those two tests in ProtostuffObjectOutputTest.java? If not so, I will close pr and issue.

More test, better. I will merge.

@beiwei30 beiwei30 merged commit 98c4677 into apache:master Aug 22, 2019
@Moriadry-zz Moriadry-zz deleted the feature/test-protostuff branch August 22, 2019 09:28
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.

protostuff return stackoverflow and other error msg
5 participants