You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2018/12/14 03:39:37 UTC

[GitHub] [incubator-dubbo] beiwei30 opened pull request #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

## What is the purpose of the change

Fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter. The original changes are: d0e41e8733d0837653e5b2281f6d4b9f9508c2c1 and 2fad342ce1bd6afe683b001d063c82fb89237b48. 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:

- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/incubator-dubbo/issues) 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](https://github.com/apache/incubator-dubbo/tree/master/dubbo-test).
- [ ] 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](https://github.com/apache/incubator-dubbo/wiki/Software-donation-guide).


[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] chickenlj closed pull request #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ pull request closed by chickenlj ]

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] beiwei30 commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
we remove the original semaphore solution because we believe this approach is more understandable.

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] codecov-io commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@2fad342`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `88.57%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master    #2963   +/-   ##
=========================================
  Coverage          ?   64.06%           
=========================================
  Files             ?      584           
  Lines             ?    26040           
  Branches          ?     4559           
=========================================
  Hits              ?    16683           
  Misses            ?     7186           
  Partials          ?     2171
```


| [Impacted Files](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../src/main/java/org/apache/dubbo/rpc/RpcStatus.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNTdGF0dXMuamF2YQ==) | `68.88% <100%> (ø)` | |
| [...rg/apache/dubbo/rpc/filter/ExecuteLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvRXhlY3V0ZUxpbWl0RmlsdGVyLmphdmE=) | `86.66% <100%> (ø)` | |
| [...org/apache/dubbo/rpc/filter/ActiveLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvQWN0aXZlTGltaXRGaWx0ZXIuamF2YQ==) | `88.23% <83.33%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=footer). Last update [2fad342...006f1b0](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
I think this patch works fine in concurrent circumstances.

A small suggestion for cleaner code:
https://github.com/apache/incubator-dubbo/issues/2984

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] chickenlj commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
https://github.com/apache/incubator-dubbo/issues/2984

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] codecov-io commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=h1) Report
> Merging [#2963](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-dubbo/commit/c55845916b0ffe4d88d829f359b4bef51a9757ad?src=pr&el=desc) will **increase** coverage by `0.09%`.
> The diff coverage is `88.57%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree)

```diff
@@            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](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../src/main/java/org/apache/dubbo/rpc/RpcStatus.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNTdGF0dXMuamF2YQ==) | `68.88% <100%> (+7.12%)` | :arrow_up: |
| [...rg/apache/dubbo/rpc/filter/ExecuteLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvRXhlY3V0ZUxpbWl0RmlsdGVyLmphdmE=) | `86.66% <100%> (-0.84%)` | :arrow_down: |
| [...org/apache/dubbo/rpc/filter/ActiveLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvQWN0aXZlTGltaXRGaWx0ZXIuamF2YQ==) | `88.23% <83.33%> (+10.11%)` | :arrow_up: |
| [.../remoting/transport/netty4/NettyClientHandler.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q2xpZW50SGFuZGxlci5qYXZh) | `75% <0%> (-11.12%)` | :arrow_down: |
| [...pache/dubbo/remoting/transport/AbstractServer.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RTZXJ2ZXIuamF2YQ==) | `47.91% <0%> (-1.05%)` | :arrow_down: |
| [...pache/dubbo/registry/support/AbstractRegistry.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9zdXBwb3J0L0Fic3RyYWN0UmVnaXN0cnkuamF2YQ==) | `81.95% <0%> (+0.75%)` | :arrow_up: |
| [...apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL0R1YmJvUHJvdG9jb2wuamF2YQ==) | `66.66% <0%> (+0.83%)` | :arrow_up: |
| [...bo/remoting/transport/netty/NettyCodecAdapter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eUNvZGVjQWRhcHRlci5qYXZh) | `54.68% <0%> (+1.56%)` | :arrow_up: |
| [...rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL3RlbG5ldC9JbnZva2VUZWxuZXRIYW5kbGVyLmphdmE=) | `71.92% <0%> (+1.75%)` | :arrow_up: |
| [...dubbo/remoting/exchange/support/DefaultFuture.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | `69.79% <0%> (+2.01%)` | :arrow_up: |
| ... and [6 more](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=footer). Last update [c558459...50f6fed](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] codecov-io commented on issue #2963: fix potential concurrency issue in a simpler way for ActiveLimitFilter and ExecuteLimitFilter

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@2fad342`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `87.5%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master    #2963   +/-   ##
=========================================
  Coverage          ?   63.99%           
=========================================
  Files             ?      584           
  Lines             ?    26045           
  Branches          ?     4561           
=========================================
  Hits              ?    16667           
  Misses            ?     7202           
  Partials          ?     2176
```


| [Impacted Files](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [.../src/main/java/org/apache/dubbo/rpc/RpcStatus.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNTdGF0dXMuamF2YQ==) | `60.67% <100%> (ø)` | |
| [...rg/apache/dubbo/rpc/filter/ExecuteLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvRXhlY3V0ZUxpbWl0RmlsdGVyLmphdmE=) | `89.47% <100%> (ø)` | |
| [...org/apache/dubbo/rpc/filter/ActiveLimitFilter.java](https://codecov.io/gh/apache/incubator-dubbo/pull/2963/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvQWN0aXZlTGltaXRGaWx0ZXIuamF2YQ==) | `88.88% <85.18%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=footer). Last update [2fad342...50dd0c4](https://codecov.io/gh/apache/incubator-dubbo/pull/2963?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2963 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org