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

[ISSUE #3318] Fix keep waiting for acquiring memory unexpectedly #3335

Merged
merged 2 commits into from Apr 26, 2022

Conversation

Albertsirius
Copy link
Contributor

@Albertsirius Albertsirius commented Apr 26, 2022

Issue #3318 , fix MemoryLimiter.acquireInterruptibly keep waiting unexpectedly error. Add an unit test class MemoryLimiterTest

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed mvn clean install -Dmaven.javadoc.skip=true.

final long objectSize = inst.getObjectSize(o);
while (sum + objectSize >= memoryLimit) {
while (memory.sum() + objectSize >= memoryLimit) {
Copy link
Member

Choose a reason for hiding this comment

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

hi,sum + objectSize and memory.sum() + objectSize

What's the difference?

Copy link
Member

Choose a reason for hiding this comment

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

In the while loop, memory.sum() gets the latest value.

@loongs-zhang
Copy link
Member

@loongs-zhang loongs-zhang added this to the 2.5.0 milestone Apr 26, 2022
@loongs-zhang loongs-zhang added the common common label Apr 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

Merging #3335 (71fbc82) into master (378283b) will increase coverage by 0.30%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master    #3335      +/-   ##
============================================
+ Coverage     65.40%   65.71%   +0.30%     
- Complexity     5204     5230      +26     
============================================
  Files           746      746              
  Lines         21020    21024       +4     
  Branches       1919     1920       +1     
============================================
+ Hits          13749    13816      +67     
+ Misses         5992     5925      -67     
- Partials       1279     1283       +4     
Impacted Files Coverage Δ
...apache/shenyu/common/concurrent/MemoryLimiter.java 75.59% <50.00%> (+56.05%) ⬆️
...g/apache/shenyu/admin/shiro/config/ShiroRealm.java 87.09% <0.00%> (-12.91%) ⬇️
...henyu/plugin/grpc/resolver/ShenyuNameResolver.java 63.82% <0.00%> (-8.52%) ⬇️
.../plugin/grpc/loadbalance/AbstractLoadBalancer.java 70.65% <0.00%> (-7.61%) ⬇️
.../org/apache/shenyu/plugin/divide/DividePlugin.java 38.63% <0.00%> (-3.23%) ⬇️
...common/dto/convert/rule/impl/DivideRuleHandle.java 75.75% <0.00%> (-1.39%) ⬇️
.../admin/service/impl/DataPermissionServiceImpl.java 90.27% <0.00%> (ø)
...e/shenyu/plugin/springcloud/SpringCloudPlugin.java 70.58% <0.00%> (ø)
...shenyu/admin/service/impl/MetaDataServiceImpl.java 93.90% <0.00%> (+0.15%) ⬆️
...che/shenyu/sync/data/http/HttpSyncDataService.java 83.73% <0.00%> (+6.50%) ⬆️
... and 2 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 378283b...71fbc82. Read the comment docs.

@loongs-zhang loongs-zhang self-requested a review April 26, 2022 12:24
@loongs-zhang loongs-zhang merged commit bb6d881 into apache:master Apr 26, 2022
@loongs-zhang
Copy link
Member

@Albertsirius thanks for your contribution !

@Albertsirius Albertsirius deleted the 3318 branch April 26, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants