dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

JVMUtil performance improvement: fix #13327

Open Linchen-Xu opened this issue 2 years ago • 3 comments

Moved from #13334 due to branch operation error.

What is the purpose of the change

fix #13327

  • dubbo.jstack-dump.max-line can be used to indicate that all stack trace lines should be printed now by setting it to a negative number, -1 for example.
  • write stack trace info directly into OutputStream instead of building a String.
  • Add tests in JVMUtilTest.

Brief changelog

  • Support custom print stack depth and write error messages directly into OutputStream in org.apache.dubbo.common.utils.JVMUtil.
  • Add tests in org.apache.dubbo.common.utils.JVMUtilTest.
  • Add stack dump test code in AbortPolicyWithReportTest.

Verifying this change

Checklist

  • [x] 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.
  • [x] Each commit in the pull request should have a meaningful subject line and body.
  • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • [x] 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.
  • [ ] Add some description to dubbo-website project if you are requesting to add a feature. (will do after it is merged)
  • [ ] GitHub Actions works fine on your own branch.
  • [ ] If this contribution is large, please follow the Software Donation Guide.

Linchen-Xu avatar Nov 14 '23 18:11 Linchen-Xu

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c2b273e) 69.56% compared to head (a3b875c) 69.59%. Report is 5 commits behind head on 3.2.

Additional details and impacted files
@@             Coverage Diff              @@
##                3.2   #13358      +/-   ##
============================================
+ Coverage     69.56%   69.59%   +0.02%     
  Complexity        2        2              
============================================
  Files          1652     1652              
  Lines         71608    71609       +1     
  Branches      10264    10263       -1     
============================================
+ Hits          49814    49835      +21     
+ Misses        17098    17086      -12     
+ Partials       4696     4688       -8     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Nov 15 '23 04:11 codecov-commenter

@CrazyHZM PTAL

AlbumenJ avatar Nov 20 '23 02:11 AlbumenJ