This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new d28a109cc fix issue #2619: set the right default maxMsgLength for
getty (#3038)
d28a109cc is described below
commit d28a109cca02f3cf9f2f7b39ab9e1fba4a95b24c
Author: Ma Zheng <[email protected]>
AuthorDate: Thu Sep 25 13:34:45 2025 +0800
fix issue #2619: set the right default maxMsgLength for getty (#3038)
* MaxMsgLen default value change
* 定义const DefaultMaxMsgLen
* 修改testdata max_msg_len
---------
Co-authored-by: mazheng <[email protected]>
---
config/testdata/consumer_config.properties | 2 +-
config/testdata/consumer_config.yml | 32 +++++++++++++++---------------
config/testdata/provider_config.properties | 2 +-
remoting/getty/config.go | 8 +++++---
4 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/config/testdata/consumer_config.properties
b/config/testdata/consumer_config.properties
index e370813b3..7a551e113 100644
--- a/config/testdata/consumer_config.properties
+++ b/config/testdata/consumer_config.properties
@@ -48,5 +48,5 @@ protocol_conf.dubbo.getty_session_param.pkg_wq_size=512
protocol_conf.dubbo.getty_session_param.tcp_read_timeout=1s
protocol_conf.dubbo.getty_session_param.tcp_write_timeout=5s
protocol_conf.dubbo.getty_session_param.wait_timeout=1s
-protocol_conf.dubbo.getty_session_param.max_msg_len=1024
+protocol_conf.dubbo.getty_session_param.max_msg_len=1024000
protocol_conf.dubbo.getty_session_param.session_name=client
\ No newline at end of file
diff --git a/config/testdata/consumer_config.yml
b/config/testdata/consumer_config.yml
index 3524262d3..a71ea0143 100644
--- a/config/testdata/consumer_config.yml
+++ b/config/testdata/consumer_config.yml
@@ -1,18 +1,18 @@
-# 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.
-
+# 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.
+
# dubbo client yaml configure file
filter: ""
@@ -107,5 +107,5 @@ protocol_conf:
wait_timeout: "1s"
# maximum len of data per request
# this refers to the total amount of data requested or returned
- max_msg_len: 102400
+ max_msg_len: 1024000
session_name: "client"
diff --git a/config/testdata/provider_config.properties
b/config/testdata/provider_config.properties
index 11b1909aa..6a1e96409 100644
--- a/config/testdata/provider_config.properties
+++ b/config/testdata/provider_config.properties
@@ -54,5 +54,5 @@ protocol_conf.dubbo.getty_session_param.pkg_wq_size=512
protocol_conf.dubbo.getty_session_param.tcp_read_timeout=1s
protocol_conf.dubbo.getty_session_param.tcp_write_timeout=5s
protocol_conf.dubbo.getty_session_param.wait_timeout=1s
-protocol_conf.dubbo.getty_session_param.max_msg_len=1024
+protocol_conf.dubbo.getty_session_param.max_msg_len=1024000
protocol_conf.dubbo.getty_session_param.session_name=server
\ No newline at end of file
diff --git a/remoting/getty/config.go b/remoting/getty/config.go
index 4f32a8229..992af254c 100644
--- a/remoting/getty/config.go
+++ b/remoting/getty/config.go
@@ -33,6 +33,8 @@ import (
const (
TCPReadWriteTimeoutMinValue = time.Second * 1
+ // DefaultMaxMsgLen defines the default maximum message length for
getty session
+ DefaultMaxMsgLen = 1024000 // 1MB
)
type (
@@ -51,7 +53,7 @@ type (
tcpWriteTimeout time.Duration
WaitTimeout string `default:"7s" yaml:"wait-timeout"
json:"wait-timeout,omitempty"`
waitTimeout time.Duration
- MaxMsgLen int `default:"1024" yaml:"max-msg-len"
json:"max-msg-len,omitempty"`
+ MaxMsgLen int `default:"1024000" yaml:"max-msg-len"
json:"max-msg-len,omitempty"`
SessionName string `default:"rpc" yaml:"session-name"
json:"session-name,omitempty"`
}
@@ -134,7 +136,7 @@ func GetDefaultClientConfig() *ClientConfig {
TcpReadTimeout: "1s",
TcpWriteTimeout: "5s",
WaitTimeout: "1s",
- MaxMsgLen: 102400,
+ MaxMsgLen: DefaultMaxMsgLen,
SessionName: "client",
},
}
@@ -160,7 +162,7 @@ func GetDefaultServerConfig() *ServerConfig {
TcpReadTimeout: "1s",
TcpWriteTimeout: "5s",
WaitTimeout: "1s",
- MaxMsgLen: 102400,
+ MaxMsgLen: DefaultMaxMsgLen,
SessionName: "server",
},
}