justxuewei commented on code in PR #2246:
URL: https://github.com/apache/dubbo-go/pull/2246#discussion_r1136566286
##########
protocol/grpc/client.go:
##########
@@ -61,7 +61,16 @@ func NewClient(url *common.URL) (*Client, error) {
// If not, will return NoopTracer.
tracer := opentracing.GlobalTracer()
dialOpts := make([]grpc.DialOption, 0, 4)
- maxMessageSize, _ := strconv.Atoi(url.GetParam(constant.MessageSizeKey,
"4"))
+
+ // set max send and recv msg size
+ maxCallRecvMsgSize := constant.DefaultMaxCallRecvMsgSize
+ if recvMsgSize, err :=
humanize.ParseBytes(url.GetParam(constant.MaxCallRecvMsgSize, "0")); err == nil
&& recvMsgSize != 0 {
Review Comment:
Why does here use "0" as default? For MaxServerRecvMsgSize, the default
value is "".
```go
if recvMsgSize, err :=
humanize.ParseBytes(url.GetParam(constant.MaxServerRecvMsgSize, "")); err ==
nil && recvMsgSize != 0 {
maxServerRecvMsgSize = int(recvMsgSize)
}
##########
protocol/grpc/client.go:
##########
@@ -61,7 +61,16 @@ func NewClient(url *common.URL) (*Client, error) {
// If not, will return NoopTracer.
tracer := opentracing.GlobalTracer()
dialOpts := make([]grpc.DialOption, 0, 4)
- maxMessageSize, _ := strconv.Atoi(url.GetParam(constant.MessageSizeKey,
"4"))
+
+ // set max send and recv msg size
+ maxCallRecvMsgSize := constant.DefaultMaxCallRecvMsgSize
+ if recvMsgSize, err :=
humanize.ParseBytes(url.GetParam(constant.MaxCallRecvMsgSize, "0")); err == nil
&& recvMsgSize != 0 {
+ maxCallRecvMsgSize = int(recvMsgSize)
+ }
+ maxCallSendMsgSize := constant.DefaultMaxCallSendMsgSize
+ if sendMsgSize, err :=
humanize.ParseBytes(url.GetParam(constant.MaxCallSendMsgSize, "0")); err == nil
&& sendMsgSize != 0 {
+ maxCallSendMsgSize = int(sendMsgSize)
+ }
Review Comment:
Same above.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]