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

fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter #2963

Merged
merged 5 commits into from
Dec 17, 2018

Conversation

beiwei30
Copy link
Member

What is the purpose of the change

Fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter. The original changes are: d0e41e8 and 2fad342. The semaphores introduced on RpcStatus are a little bit confusing.

Brief changelog

dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcStatus.java
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExecuteLimitFilter.java

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 integration-test in test module.
  • Run mvn clean install -DskipTests & 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.

@codecov-io
Copy link

codecov-io commented Dec 14, 2018

Codecov Report

Merging #2963 into master will increase coverage by 0.09%.
The diff coverage is 88.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2963      +/-   ##
==========================================
+ Coverage   63.95%   64.04%   +0.09%     
==========================================
  Files         584      584              
  Lines       26059    26040      -19     
  Branches     4562     4559       -3     
==========================================
+ Hits        16666    16678      +12     
+ Misses       7217     7194      -23     
+ Partials     2176     2168       -8
Impacted Files Coverage Δ
.../src/main/java/org/apache/dubbo/rpc/RpcStatus.java 68.88% <100%> (+7.12%) ⬆️
...rg/apache/dubbo/rpc/filter/ExecuteLimitFilter.java 86.66% <100%> (-0.84%) ⬇️
...org/apache/dubbo/rpc/filter/ActiveLimitFilter.java 88.23% <83.33%> (+10.11%) ⬆️
.../remoting/transport/netty4/NettyClientHandler.java 75% <0%> (-11.12%) ⬇️
...pache/dubbo/remoting/transport/AbstractServer.java 47.91% <0%> (-1.05%) ⬇️
...pache/dubbo/registry/support/AbstractRegistry.java 81.95% <0%> (+0.75%) ⬆️
...apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java 66.66% <0%> (+0.83%) ⬆️
...bo/remoting/transport/netty/NettyCodecAdapter.java 54.68% <0%> (+1.56%) ⬆️
...rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java 71.92% <0%> (+1.75%) ⬆️
...dubbo/remoting/exchange/support/DefaultFuture.java 69.79% <0%> (+2.01%) ⬆️
... and 6 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 c558459...50f6fed. Read the comment docs.

@chickenlj
Copy link
Contributor

chickenlj commented Dec 17, 2018

I think this patch works fine in concurrent circumstances.

A small suggestion for cleaner code:
#2984

@chickenlj chickenlj merged commit e6e7ea8 into apache:master Dec 17, 2018
@beiwei30 beiwei30 deleted the code-enhance branch December 17, 2018 08:55
@beiwei30
Copy link
Member Author

we remove the original semaphore solution because we believe this approach is more understandable.

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.

3 participants