Skip to content

Put the lock acquisition in front of try#1944

Closed
ZhichX wants to merge 25 commits intoapache:masterfrom
ZhichX:master
Closed

Put the lock acquisition in front of try#1944
ZhichX wants to merge 25 commits intoapache:masterfrom
ZhichX:master

Conversation

@ZhichX
Copy link
Copy Markdown
Contributor

@ZhichX ZhichX commented Jun 14, 2018

What is the purpose of the change

Put lock.lock() in try{...}, when lock.lock() reports an error, it will also enter the finally release lock. According to the Lock.unlock() document, an unchecked exception will be thrown when the non-lock holding thread calls this method:

Brief changelog

Put the lock acquisition in front of try

Verifying this change

XXXXX

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

  • Make sure there is a GITHUB_issue filed 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.

Copy link
Copy Markdown
Member

@carryxyh carryxyh left a comment

Choose a reason for hiding this comment

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

u should rebase your branch onto remote master first
And also, there is a pr which is rename the repackage to org.apache. Please resend a PR after the repackage PR

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 14, 2018

Codecov Report

Merging #1944 into master will increase coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #1944      +/-   ##
===========================================
+ Coverage     50.31%   50.4%   +0.09%     
- Complexity     4736    4740       +4     
===========================================
  Files           518     518              
  Lines         25421   25424       +3     
  Branches       4546    4560      +14     
===========================================
+ Hits          12790   12815      +25     
+ Misses        10670   10654      -16     
+ Partials       1961    1955       -6
Impacted Files Coverage Δ Complexity Δ
...he/dubbo/remoting/transport/netty/NettyClient.java 72.88% <0%> (-1.26%) 12% <0%> (ø)
...e/dubbo/remoting/transport/netty4/NettyClient.java 63.33% <0%> (-1.08%) 11% <0%> (ø)
...ache/dubbo/remoting/transport/mina/MinaClient.java 58.46% <0%> (-0.92%) 9% <0%> (ø)
.../java/org/apache/dubbo/config/ReferenceConfig.java 47.68% <0%> (+0.71%) 38% <0%> (ø) ⬇️
.../dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java 45.31% <0%> (+1.56%) 8% <0%> (ø) ⬇️
...he/dubbo/registry/multicast/MulticastRegistry.java 57.74% <0%> (+1.67%) 41% <0%> (+3%) ⬆️
...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java 89.71% <0%> (+1.86%) 15% <0%> (ø) ⬇️
...in/java/org/apache/dubbo/common/utils/IOUtils.java 86.95% <0%> (+2.17%) 16% <0%> (+1%) ⬆️
...va/org/apache/dubbo/remoting/exchange/Request.java 85.71% <0%> (+2.38%) 20% <0%> (ø) ⬇️
...bo/rpc/protocol/dubbo/telnet/LogTelnetHandler.java 71.42% <0%> (+2.85%) 3% <0%> (ø) ⬇️
... and 3 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 e92a553...d84ffde. Read the comment docs.

@diecui1202
Copy link
Copy Markdown

Hi, @ZhichX As now we are working on the rename package to org.apache, so I suggest you could resend a new PR after that is merged.

@ZhichX
Copy link
Copy Markdown
Contributor Author

ZhichX commented Jun 15, 2018

ok, I'll resend a new PR

@diecui1202
Copy link
Copy Markdown

Appreciate for that.

谢志春 zhichun.xie added 3 commits June 15, 2018 15:58
# Conflicts:
#	dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/LRUCache.java
#	dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/DubboShutdownHook.java
#	dubbo-container/dubbo-container-api/src/main/java/com/alibaba/dubbo/container/Main.java
#	dubbo-filter/dubbo-filter-cache/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.cache.CacheFactory
#	dubbo-filter/dubbo-filter-cache/src/test/java/com/alibaba/dubbo/cache/filter/CacheFilterTest.java
#	dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/ExplicitCallbackTest.java
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.

4 participants