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 2020/12/09 02:11:48 UTC

[GitHub] [dubbo-go] LaurenceLiZhixin opened a new pull request #915: Fix/health check

LaurenceLiZhixin opened a new pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915


   <!--  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**:
   Change old checkHealth logic to new logic.
   
   **Which issue(s) this PR fixes**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
   -->
   Fixes #
   
   **Special notes for your reviewer**:
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
   -->
   ```release-note
   
   ```


----------------------------------------------------------------
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.

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] LaurenceLiZhixin commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r549950654



##########
File path: protocol/rpc_status.go
##########
@@ -30,12 +30,17 @@ import (
 )
 
 var (
-	methodStatistics    sync.Map // url -> { methodName : RPCStatus}
-	serviceStatistic    sync.Map // url -> RPCStatus
-	invokerBlackList    sync.Map // store unhealthy url blackList
-	blackListRefreshing int32    // store if the refresing method is processing
+	methodStatistics    sync.Map     // url -> { methodName : RPCStatus}
+	serviceStatistic    sync.Map     // url -> RPCStatus
+	invokerBlackList    sync.Map     // store unhealthy url blackList
+	blackListCacheDirty atomic.Value // store if the cache in chain is not refreshed by blacklist

Review comment:
       fixed




----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (c822cfa) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.03%`.
   > The diff coverage is `41.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.87%   -0.04%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12987      +75     
   ===========================================
   + Hits          7736     7776      +40     
   - Misses        4224     4256      +32     
   - Partials       952      955       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `50.00% <5.26%> (-31.49%)` | :arrow_down: |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `70.24% <60.00%> (-0.85%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `61.62% <62.50%> (+0.51%)` | :arrow_up: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [8 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...c822cfa](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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] AlexStocks commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r549726231



##########
File path: protocol/rpc_status.go
##########
@@ -30,12 +30,17 @@ import (
 )
 
 var (
-	methodStatistics    sync.Map // url -> { methodName : RPCStatus}
-	serviceStatistic    sync.Map // url -> RPCStatus
-	invokerBlackList    sync.Map // store unhealthy url blackList
-	blackListRefreshing int32    // store if the refresing method is processing
+	methodStatistics    sync.Map     // url -> { methodName : RPCStatus}
+	serviceStatistic    sync.Map     // url -> RPCStatus
+	invokerBlackList    sync.Map     // store unhealthy url blackList
+	blackListCacheDirty atomic.Value // store if the cache in chain is not refreshed by blacklist

Review comment:
       pls using uber atomic package instead.




----------------------------------------------------------------
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.

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] cvictory commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
cvictory commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r541860297



##########
File path: config/reference_config.go
##########
@@ -41,30 +41,31 @@ import (
 
 // ReferenceConfig is the configuration of service consumer
 type ReferenceConfig struct {
-	context        context.Context
-	pxy            *proxy.Proxy
-	id             string
-	InterfaceName  string            `required:"true"  yaml:"interface"  json:"interface,omitempty" property:"interface"`
-	Check          *bool             `yaml:"check"  json:"check,omitempty" property:"check"`
-	Url            string            `yaml:"url"  json:"url,omitempty" property:"url"`
-	Filter         string            `yaml:"filter" json:"filter,omitempty" property:"filter"`
-	Protocol       string            `default:"dubbo"  yaml:"protocol"  json:"protocol,omitempty" property:"protocol"`
-	Registry       string            `yaml:"registry"  json:"registry,omitempty"  property:"registry"`
-	Cluster        string            `yaml:"cluster"  json:"cluster,omitempty" property:"cluster"`
-	Loadbalance    string            `yaml:"loadbalance"  json:"loadbalance,omitempty" property:"loadbalance"`
-	Retries        string            `yaml:"retries"  json:"retries,omitempty" property:"retries"`
-	Group          string            `yaml:"group"  json:"group,omitempty" property:"group"`
-	Version        string            `yaml:"version"  json:"version,omitempty" property:"version"`
-	ProvideBy      string            `yaml:"provide_by"  json:"provide_by,omitempty" property:"provide_by"`
-	Methods        []*MethodConfig   `yaml:"methods"  json:"methods,omitempty" property:"methods"`
-	Async          bool              `yaml:"async"  json:"async,omitempty" property:"async"`
-	Params         map[string]string `yaml:"params"  json:"params,omitempty" property:"params"`
-	invoker        protocol.Invoker
-	urls           []*common.URL
-	Generic        bool   `yaml:"generic"  json:"generic,omitempty" property:"generic"`
-	Sticky         bool   `yaml:"sticky"   json:"sticky,omitempty" property:"sticky"`
-	RequestTimeout string `yaml:"timeout"  json:"timeout,omitempty" property:"timeout"`
-	ForceTag       bool   `yaml:"force.tag"  json:"force.tag,omitempty" property:"force.tag"`
+	context           context.Context
+	pxy               *proxy.Proxy
+	id                string
+	InterfaceName     string            `required:"true"  yaml:"interface"  json:"interface,omitempty" property:"interface"`
+	Check             *bool             `yaml:"check"  json:"check,omitempty" property:"check"`
+	Url               string            `yaml:"url"  json:"url,omitempty" property:"url"`
+	Filter            string            `yaml:"filter" json:"filter,omitempty" property:"filter"`
+	Protocol          string            `default:"dubbo"  yaml:"protocol"  json:"protocol,omitempty" property:"protocol"`
+	Registry          string            `yaml:"registry"  json:"registry,omitempty"  property:"registry"`
+	Cluster           string            `yaml:"cluster"  json:"cluster,omitempty" property:"cluster"`
+	Loadbalance       string            `yaml:"loadbalance"  json:"loadbalance,omitempty" property:"loadbalance"`
+	Retries           string            `yaml:"retries"  json:"retries,omitempty" property:"retries"`
+	Group             string            `yaml:"group"  json:"group,omitempty" property:"group"`
+	Version           string            `yaml:"version"  json:"version,omitempty" property:"version"`
+	ProvideBy         string            `yaml:"provide_by"  json:"provide_by,omitempty" property:"provide_by"`
+	Methods           []*MethodConfig   `yaml:"methods"  json:"methods,omitempty" property:"methods"`
+	Async             bool              `yaml:"async"  json:"async,omitempty" property:"async"`
+	Params            map[string]string `yaml:"params"  json:"params,omitempty" property:"params"`
+	invoker           protocol.Invoker
+	urls              []*common.URL
+	Generic           bool   `yaml:"generic"  json:"generic,omitempty" property:"generic"`
+	Sticky            bool   `yaml:"sticky"   json:"sticky,omitempty" property:"sticky"`
+	RequestTimeout    string `yaml:"timeout"  json:"timeout,omitempty" property:"timeout"`
+	ForceTag          bool   `yaml:"force.tag"  json:"force.tag,omitempty" property:"force.tag"`
+	HealthCheckEnable bool   `yaml:"health_check" json:"health_check,omitempty" property:"health_check"`

Review comment:
       这个放到Params里有什么问题?




----------------------------------------------------------------
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.

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] AlexStocks commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r549726308



##########
File path: protocol/rpc_status.go
##########
@@ -30,12 +30,17 @@ import (
 )
 
 var (
-	methodStatistics    sync.Map // url -> { methodName : RPCStatus}
-	serviceStatistic    sync.Map // url -> RPCStatus
-	invokerBlackList    sync.Map // store unhealthy url blackList
-	blackListRefreshing int32    // store if the refresing method is processing
+	methodStatistics    sync.Map     // url -> { methodName : RPCStatus}
+	serviceStatistic    sync.Map     // url -> RPCStatus
+	invokerBlackList    sync.Map     // store unhealthy url blackList
+	blackListCacheDirty atomic.Value // store if the cache in chain is not refreshed by blacklist

Review comment:
       atomic.Bool




----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (c1cc113) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.18%`.
   > The diff coverage is `42.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.72%   -0.19%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12992      +80     
   ===========================================
   + Hits          7736     7760      +24     
   - Misses        4224     4277      +53     
   - Partials       952      955       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `50.00% <5.26%> (-31.49%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `70.63% <78.57%> (-0.46%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [7 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...c1cc113](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (210691c) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.25%`.
   > The diff coverage is `38.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.65%   -0.26%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12987      +75     
   ===========================================
   + Hits          7736     7748      +12     
   - Misses        4224     4284      +60     
   - Partials       952      955       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `50.00% <5.26%> (-31.49%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `70.24% <60.00%> (-0.85%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [8 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...c1cc113](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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-io commented on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (8e92b2d) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.12%`.
   > The diff coverage is `41.93%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.78%   -0.13%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12975      +63     
   ===========================================
   + Hits          7736     7757      +21     
   - Misses        4224     4264      +40     
   - Partials       952      954       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `52.94% <3.22%> (-28.55%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `71.55% <100.00%> (+0.45%)` | :arrow_up: |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [8 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...8e92b2d](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (c1cc113) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.14%`.
   > The diff coverage is `42.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.76%   -0.15%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12992      +80     
   ===========================================
   + Hits          7736     7765      +29     
   - Misses        4224     4273      +49     
   - Partials       952      954       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `50.00% <5.26%> (-31.49%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `70.63% <78.57%> (-0.46%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [9 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...c1cc113](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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] cityiron commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
cityiron commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r546185105



##########
File path: cluster/router/conncheck/conn_check_route.go
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package healthcheck
+
+import (
+	"github.com/RoaringBitmap/roaring"
+)
+
+import (
+	"github.com/apache/dubbo-go/cluster/router"
+	"github.com/apache/dubbo-go/cluster/router/utils"
+	"github.com/apache/dubbo-go/common"
+	"github.com/apache/dubbo-go/common/constant"
+	"github.com/apache/dubbo-go/common/extension"
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/protocol"
+)
+
+const (
+	connHealthy = "conn-healthy"
+	name        = "conn-check-router"
+)
+
+// ConnCheckRouter provides a health-first routing mechanism through ConnChecker
+type ConnCheckRouter struct {
+	url     *common.URL
+	checker router.ConnChecker
+}
+
+// NewConnCheckRouter construct an NewConnCheckRouter via url
+func NewConnCheckRouter(url *common.URL) (router.PriorityRouter, error) {
+	r := &ConnCheckRouter{
+		url: url,
+	}
+	checkerName := url.GetParam(constant.HEALTH_CHECKER, constant.DEFAULT_HEALTH_CHECKER)
+	r.checker = extension.GetConnChecker(checkerName, url)
+	return r, nil
+}
+
+// Route gets a list of healthy invoker
+func (r *ConnCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, invocation protocol.Invocation) *roaring.Bitmap {
+	addrPool := cache.FindAddrPool(r)
+	// Add healthy invoker to the list
+	healthyInvokers := utils.JoinIfNotEqual(addrPool[connHealthy], invokers)
+	// If all invokers are considered unhealthy, downgrade to all invoker
+	if healthyInvokers.IsEmpty() {
+		logger.Warnf(" Now all invokers are unhealthy, so downgraded to all! Service: [%s]", url.ServiceKey())
+		return invokers
+	}
+	return healthyInvokers
+}
+
+// Pool separates healthy invokers from others.
+func (r *ConnCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata) {
+	rb := make(router.AddrPool, 8)
+	rb[connHealthy] = roaring.NewBitmap()
+	for i, invoker := range invokers {
+		if r.checker.IsConnHealthy(invoker) {
+			rb[connHealthy].Add(uint32(i))
+		}
+	}
+	return rb, nil
+}
+
+// ShouldPool will always return true to make sure healthy check constantly.
+func (r *ConnCheckRouter) ShouldPool() bool {
+	return true
+}
+
+func (r *ConnCheckRouter) Name() string {
+	return name
+}
+
+// Priority

Review comment:
       more comment to Introduce the method.

##########
File path: cluster/router/conncheck/factory.go
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package healthcheck
+
+import (
+	"github.com/apache/dubbo-go/cluster/router"
+	"github.com/apache/dubbo-go/common"
+	"github.com/apache/dubbo-go/common/constant"
+	"github.com/apache/dubbo-go/common/extension"
+)
+
+func init() {
+	extension.SetRouterFactory(constant.ConnCheckRouterName, newConnCheckRouteFactory)
+}
+
+// ConnCheckRouteFactory

Review comment:
       ditto

##########
File path: cluster/router/conncheck/conn_check_route.go
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package healthcheck
+
+import (
+	"github.com/RoaringBitmap/roaring"
+)
+
+import (
+	"github.com/apache/dubbo-go/cluster/router"
+	"github.com/apache/dubbo-go/cluster/router/utils"
+	"github.com/apache/dubbo-go/common"
+	"github.com/apache/dubbo-go/common/constant"
+	"github.com/apache/dubbo-go/common/extension"
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/protocol"
+)
+
+const (
+	connHealthy = "conn-healthy"
+	name        = "conn-check-router"
+)
+
+// ConnCheckRouter provides a health-first routing mechanism through ConnChecker
+type ConnCheckRouter struct {
+	url     *common.URL
+	checker router.ConnChecker
+}
+
+// NewConnCheckRouter construct an NewConnCheckRouter via url
+func NewConnCheckRouter(url *common.URL) (router.PriorityRouter, error) {
+	r := &ConnCheckRouter{
+		url: url,
+	}
+	checkerName := url.GetParam(constant.HEALTH_CHECKER, constant.DEFAULT_HEALTH_CHECKER)
+	r.checker = extension.GetConnChecker(checkerName, url)
+	return r, nil
+}
+
+// Route gets a list of healthy invoker
+func (r *ConnCheckRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, invocation protocol.Invocation) *roaring.Bitmap {
+	addrPool := cache.FindAddrPool(r)
+	// Add healthy invoker to the list
+	healthyInvokers := utils.JoinIfNotEqual(addrPool[connHealthy], invokers)
+	// If all invokers are considered unhealthy, downgrade to all invoker
+	if healthyInvokers.IsEmpty() {
+		logger.Warnf(" Now all invokers are unhealthy, so downgraded to all! Service: [%s]", url.ServiceKey())
+		return invokers
+	}
+	return healthyInvokers
+}
+
+// Pool separates healthy invokers from others.
+func (r *ConnCheckRouter) Pool(invokers []protocol.Invoker) (router.AddrPool, router.AddrMetadata) {
+	rb := make(router.AddrPool, 8)
+	rb[connHealthy] = roaring.NewBitmap()
+	for i, invoker := range invokers {
+		if r.checker.IsConnHealthy(invoker) {
+			rb[connHealthy].Add(uint32(i))
+		}
+	}
+	return rb, nil
+}
+
+// ShouldPool will always return true to make sure healthy check constantly.
+func (r *ConnCheckRouter) ShouldPool() bool {
+	return true
+}
+
+func (r *ConnCheckRouter) Name() string {

Review comment:
       comment for Name

##########
File path: protocol/rpc_status.go
##########
@@ -18,6 +18,8 @@
 package protocol
 
 import (
+	"fmt"
+	"github.com/apache/dubbo-go/common/constant"

Review comment:
       split




----------------------------------------------------------------
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.

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] LaurenceLiZhixin commented on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-742989070


   Why it always say my liscence verify failed?
   


----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (c1cc113) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.14%`.
   > The diff coverage is `42.20%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.76%   -0.15%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12992      +80     
   ===========================================
   + Hits          7736     7765      +29     
   - Misses        4224     4273      +49     
   - Partials       952      954       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `50.00% <5.26%> (-31.49%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `70.63% <78.57%> (-0.46%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [9 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [9ae3c90...c1cc113](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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] cvictory commented on a change in pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
cvictory commented on a change in pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#discussion_r541862012



##########
File path: protocol/rpc_status.go
##########
@@ -30,6 +30,7 @@ import (
 var (
 	methodStatistics sync.Map // url -> { methodName : RPCStatus}
 	serviceStatistic sync.Map // url -> RPCStatus
+	invokerBlackList sync.Map // store unhealthy url blackList

Review comment:
       这个黑名单不是全局的吧?是和服务或者ip绑定?




----------------------------------------------------------------
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.

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-io edited a comment on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751621213


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=h1) Report
   > Merging [#915](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=desc) (8e92b2d) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e308e19ad2c0c61738cd496d834bb322b0a0e626?el=desc) (e308e19) will **decrease** coverage by `0.12%`.
   > The diff coverage is `41.93%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/915/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #915      +/-   ##
   ===========================================
   - Coverage    59.91%   59.78%   -0.13%     
   ===========================================
     Files          261      265       +4     
     Lines        12912    12975      +63     
   ===========================================
   + Hits          7736     7757      +21     
   - Misses        4224     4264      +40     
   - Partials       952      954       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/healthcheck/default\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svZGVmYXVsdF9oZWFsdGhfY2hlY2suZ28=) | `100.00% <ø> (+5.88%)` | :arrow_up: |
   | [common/extension/conn\_checker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29tbW9uL2V4dGVuc2lvbi9jb25uX2NoZWNrZXIuZ28=) | `0.00% <0.00%> (ø)` | |
   | [config/reference\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y29uZmlnL3JlZmVyZW5jZV9jb25maWcuZ28=) | `80.19% <ø> (ø)` | |
   | [protocol/rpc\_status.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcnBjX3N0YXR1cy5nbw==) | `52.94% <3.22%> (-28.55%)` | :arrow_down: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `58.13% <50.00%> (-2.98%)` | :arrow_down: |
   | [cluster/router/conncheck/conn\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5fY2hlY2tfcm91dGUuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/conncheck/factory.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2ZhY3RvcnkuZ28=) | `66.66% <66.66%> (ø)` | |
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `71.55% <100.00%> (+0.45%)` | :arrow_up: |
   | [cluster/router/conncheck/conn\_health\_check.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY29ubmNoZWNrL2Nvbm5faGVhbHRoX2NoZWNrLmdv) | `100.00% <100.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `70.37% <100.00%> (ø)` | |
   | ... and [8 more](https://codecov.io/gh/apache/dubbo-go/pull/915/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/915?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/dubbo-go/pull/915?src=pr&el=footer). Last update [e308e19...f466966](https://codecov.io/gh/apache/dubbo-go/pull/915?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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] LaurenceLiZhixin closed pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin closed pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915


   


----------------------------------------------------------------
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.

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] LaurenceLiZhixin commented on pull request #915: fix: health check

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on pull request #915:
URL: https://github.com/apache/dubbo-go/pull/915#issuecomment-751445575


   > I think github action fail cause by go.sum file in project is not match to go.mod , can you rerun `go mod tidy` in your computer and submit the result?
   
   I run tidy, and it still has liscense problem.


----------------------------------------------------------------
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.

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