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/11/12 03:46:21 UTC

[GitHub] [dubbo-go] peaman opened a new pull request #874: Fix: client read timeout caused by default request timeout is 0

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


   <!--  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**:
   修复默认request timeout为0导致的错误(client read timeout)
   
   **Which issue(s) this PR fixes**:
   None
   <!--
   *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`_*
   -->
   
   **Special notes for your reviewer**:
   如果用户未设置timeout值,在NewDubboInvoker()方法中做了兜底
   此修改可以解决问题,但未必是最好的修复方式
   
   **Does this PR introduce a user-facing change?**:
   None
   <!--
   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] zouyx closed pull request #874: Fix: client read timeout caused by default request timeout is 0

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


   


----------------------------------------------------------------
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 #874: Fix: client read timeout caused by default request timeout is 0

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



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -73,6 +73,9 @@ func NewDubboInvoker(url common.URL, client *remoting.ExchangeClient) *DubboInvo
 	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {

Review comment:
       I think the code should be 
   
   ```go
   	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {
   		requestTimeout = time.Second * 3
   	}
   ```




----------------------------------------------------------------
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] fangyincheng commented on a change in pull request #874: Fix: client read timeout caused by default request timeout is 0

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



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -73,6 +73,9 @@ func NewDubboInvoker(url common.URL, client *remoting.ExchangeClient) *DubboInvo
 	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {
 		requestTimeout = t
 	}
+	if requestTimeout == 0 {
+		requestTimeout = time.Second * 3

Review comment:
       url.GetParam(key, default)这个方法就可以设置默认值了




----------------------------------------------------------------
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 #874: Fix: client read timeout caused by default request timeout is 0

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


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/874?src=pr&el=h1) Report
   > Merging [#874](https://codecov.io/gh/apache/dubbo-go/pull/874?src=pr&el=desc) (e5d88c4) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e928956c1acc01edd47c405c05991e0200fd912f?el=desc) (e928956) will **decrease** coverage by `0.07%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/874/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/874?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #874      +/-   ##
   ===========================================
   - Coverage    60.02%   59.94%   -0.08%     
   ===========================================
     Files          260      260              
     Lines        12795    12797       +2     
   ===========================================
   - Hits          7680     7671       -9     
   - Misses        4154     4170      +16     
   + Partials       961      956       -5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/874?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [protocol/dubbo/dubbo\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/874/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vZHViYm9faW52b2tlci5nbw==) | `75.67% <100.00%> (+0.67%)` | :arrow_up: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/874/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `52.77% <0.00%> (-8.34%)` | :arrow_down: |
   | [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/874/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9yZWdpc3RyeV9jb250cm9sbGVyLmdv) | `46.12% <0.00%> (-5.31%)` | :arrow_down: |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/874/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `77.17% <0.00%> (-2.18%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/874/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `68.72% <0.00%> (+4.40%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/874?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/874?src=pr&el=footer). Last update [e928956...e5d88c4](https://codecov.io/gh/apache/dubbo-go/pull/874?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] zouyx commented on a change in pull request #874: Fix: client read timeout caused by default request timeout is 0

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



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -73,6 +73,9 @@ func NewDubboInvoker(url common.URL, client *remoting.ExchangeClient) *DubboInvo
 	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {
 		requestTimeout = t
 	}
+	if requestTimeout == 0 {
+		requestTimeout = time.Second * 3

Review comment:
       I think this PR is set default value ,rather than how to set default value?
   
   




----------------------------------------------------------------
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] peaman commented on a change in pull request #874: Fix: client read timeout caused by default request timeout is 0

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



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -73,6 +73,9 @@ func NewDubboInvoker(url common.URL, client *remoting.ExchangeClient) *DubboInvo
 	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {
 		requestTimeout = t
 	}
+	if requestTimeout == 0 {
+		requestTimeout = time.Second * 3

Review comment:
       I noticed this method,How do you think I should modify it ?
   




----------------------------------------------------------------
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] peaman commented on a change in pull request #874: Fix: client read timeout caused by default request timeout is 0

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



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -73,6 +73,9 @@ func NewDubboInvoker(url common.URL, client *remoting.ExchangeClient) *DubboInvo
 	if t, err := time.ParseDuration(requestTimeoutStr); err == nil {

Review comment:
       it is because  `time.ParseDuration(requestTimeoutStr); err ==nil` is false, so requestTimeout is 0
   I think it not solve the 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


[GitHub] [dubbo-go] zouyx commented on pull request #874: Fix: client read timeout caused by default request timeout is 0

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


   You should need to use code as below for make all variable has default value before set custom value.
   ```golang
   consumerConfig := &config.ConsumerConfig{}
   yaml.UnmarshalYML([]byte("{}"), consumerConfig)
   ```


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