You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/07/15 09:36:11 UTC

[GitHub] [dubbo-go] TheR1sing3un opened a new pull request, #1970: perf(offline): using sliding window during gracefully shutdown

TheR1sing3un opened a new pull request, #1970:
URL: https://github.com/apache/dubbo-go/pull/1970

   gracefully shutdown
   
   1. using sliding window for better logic to support gracefully shutdown,
   
   Signed-off-by: TheR1sing3un <87...@users.noreply.github.com>
   
   <!--  Thanks for sending a pull request!
   Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request.
   -->
   
   **What this PR does**: 
   
   ![image-20220607195015283](https://ther1sing3un-personal-resource.oss-cn-beijing.aliyuncs.com/typora/images/image-20220607195015283.png)
   
   原本的逻辑是以10ms为间隔轮询counter,在等待未超时的情况下,一旦发现counter为0,就结束该步骤了。那么这样可能会有问题,在那一轮询counter的一瞬间,当前的请求刚好都返回,但是在这一瞬间之前一直都有请求过来,在这瞬间之后也仍有请求继续。那么这时候结束该步骤是不妥的,因此可以维护一个滑动窗口,假设窗口期为x ms,在x ms之内都没有新的请求到来,那么这时候就可以认为该步骤可以结束了。
   算法思路就是,在counter计数的基础上,维护一个最近一个请求的时间戳。
   该改动在当前版本不会体现出作用,因为目前的优雅下线在该步骤之前已经拒绝了请求,因此滑动窗口现在还不会起作用,后续开发的下线逻辑在该处就不会直接拒绝这些请求,而是先放进来,然后使用到该处的滑动窗口逻辑来进行优雅下线,并且在响应中携带标识使客户端做出相应处理。
   
   **Which issue(s) this PR fixes**: 
   Fixes #
   
   **You should pay attention to items below to ensure your pr passes our ci test**
   We do not merge pr with ci tests failed
   
   - [ ] All ut passed (run 'go test ./...' in project root)
   - [ ] After go-fmt ed , run 'go fmt project' using goland.
   - [ ] Golangci-lint passed, run 'sudo golangci-lint run' in project root.
   - [ ] After import formatted, (using [imports-formatter](https://github.com/dubbogo/tools#5-how-to-get-imports-formatter) to run 'imports-formatter .' in project root, to format your import blocks, mentioned in [CONTRIBUTING.md](https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md) above) 
   - [ ] Your new-created file needs to have [apache license](https://raw.githubusercontent.com/dubbogo/resources/master/tools/license/license.txt) at the top, like other existed file does.
   - [ ] All integration test passed. You can run integration test locally (with docker env). Clone our [dubbo-go-samples](https://github.com/apache/dubbo-go-samples) project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] TheR1sing3un commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
TheR1sing3un commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1186150048

   > 
   
   hi,这一块是后续的不基于优雅下限的任务的第一个小功能点,您提到的注册中心移除之后,就没有多少新的请求进来,这里目前是这个逻辑,但是之后使用不基于注册中心的实现的时候,不会直接拒绝这些新请求,而是让它们进入,并且处理之后在响应中携带相应的标识来让客户端感知到服务端处于下线期间。
   目前的逻辑改成窗口期为0是不会影响到目前的下线逻辑,因此也是一个平滑升级。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] TheR1sing3un closed pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
TheR1sing3un closed pull request #1970: perf(offline): using sliding window during gracefully shutdown
URL: https://github.com/apache/dubbo-go/pull/1970


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] TheR1sing3un commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
TheR1sing3un commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1185365627

   @LaurenceLiZhixin PING! Please check!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] codecov-commenter commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1185446978

   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1970](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6b5f009) into [3.0](https://codecov.io/gh/apache/dubbo-go/commit/0935a8e5405c877dd16c7003115ee8b0f32476e3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0935a8e) will **decrease** coverage by `0.56%`.
   > The diff coverage is `66.66%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##              3.0    #1970      +/-   ##
   ==========================================
   - Coverage   44.98%   44.42%   -0.57%     
   ==========================================
     Files         287      283       -4     
     Lines       17130    17037      -93     
   ==========================================
   - Hits         7706     7568     -138     
   - Misses       8613     8667      +54     
   + Partials      811      802       -9     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/graceful\_shutdown.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2dyYWNlZnVsX3NodXRkb3duLmdv) | `3.88% <0.00%> (-0.12%)` | :arrow_down: |
   | [filter/graceful\_shutdown/provider\_filter.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL2dyYWNlZnVsX3NodXRkb3duL3Byb3ZpZGVyX2ZpbHRlci5nbw==) | `74.35% <ø> (+0.67%)` | :arrow_up: |
   | [config/graceful\_shutdown\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2dyYWNlZnVsX3NodXRkb3duX2NvbmZpZy5nbw==) | `92.72% <100.00%> (+17.72%)` | :arrow_up: |
   | [config/config\_center\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19jZW50ZXJfY29uZmlnLmdv) | `14.28% <0.00%> (-58.10%)` | :arrow_down: |
   | [filter/metrics/filter.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL21ldHJpY3MvZmlsdGVyLmdv) | `85.00% <0.00%> (-15.00%)` | :arrow_down: |
   | [config/provider\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3ZpZGVyX2NvbmZpZy5nbw==) | `41.53% <0.00%> (-3.47%)` | :arrow_down: |
   | [cluster/loadbalance/ringhash/ring.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9sb2FkYmFsYW5jZS9yaW5naGFzaC9yaW5nLmdv) | `84.50% <0.00%> (-2.82%)` | :arrow_down: |
   | [metrics/prometheus/reporter.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0cmljcy9wcm9tZXRoZXVzL3JlcG9ydGVyLmdv) | `33.33% <0.00%> (-1.70%)` | :arrow_down: |
   | [remoting/xds/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3RpbmcveGRzL2NsaWVudC5nbw==) | `53.23% <0.00%> (-0.77%)` | :arrow_down: |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `31.97% <0.00%> (-0.33%)` | :arrow_down: |
   | ... and [108 more](https://codecov.io/gh/apache/dubbo-go/pull/1970/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [0935a8e...6b5f009](https://codecov.io/gh/apache/dubbo-go/pull/1970?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] justxuewei commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
justxuewei commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1186154660

   > > 
   > 
   > hi,这一块是后续的不基于优雅下限的任务的第一个小功能点,您提到的注册中心移除之后,就没有多少新的请求进来,这里目前是这个逻辑,但是之后使用不基于注册中心的实现的时候,不会直接拒绝这些新请求,而是让它们进入,并且处理之后在响应中携带相应的标识来让客户端感知到服务端处于下线期间。 目前的逻辑改成窗口期为0是不会影响到目前的下线逻辑,因此也是一个平滑升级。
   
   Gotcha!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] justxuewei commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
justxuewei commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1186158100

   BTW, our development branch is **3.0** instead of master, so I suggest you that close this pr and open a new PR setting to our development branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] justxuewei commented on pull request #1970: perf(offline): using sliding window during gracefully shutdown

Posted by GitBox <gi...@apache.org>.
justxuewei commented on PR #1970:
URL: https://github.com/apache/dubbo-go/pull/1970#issuecomment-1186145071

   Hi @TheR1sing3un, this feature is not necessary IMO. Before the dubbo-go server goes down, its registered information was removed from the registry, so it shouldn't have too much **new** requests coming in, in other words, the requests will reduce sharply. Do you have any further information to describe what problem you are experiencing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org