AlexStocks commented on code in PR #3613:
URL: https://github.com/apache/dubbo-go/pull/3613#discussion_r3740541867
##########
global/protocol_config.go:
##########
@@ -31,20 +31,6 @@ type ProtocolConfig struct {
Params any `yaml:"params" json:"params,omitempty" property:"params"`
TripleConfig *TripleConfig `yaml:"triple" json:"triple,omitempty"
property:"triple"`
-
- // TODO: remove MaxServerSendMsgSize and MaxServerRecvMsgSize when
version 4.0.0
- //
- // MaxServerSendMsgSize max size of server send message,
1mb=1000kb=1000000b 1mib=1024kb=1048576b.
- // more detail to see
https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants
- //
- // Deprecated: use
"ClientProtocolConfig.TripleConfig.MaxServerSendMsgSize" or in config tag
"protocol_config/triple/max-server-send-msg-size" instead
- MaxServerSendMsgSize string `yaml:"max-server-send-msg-size"
json:"max-server-send-msg-size,omitempty"`
Review Comment:
[P1] 保留 v3 公开字段直到主版本升级
当前模块路径仍是 `dubbo.apache.org/dubbo-go/v3`,最新发布标签也是 v3.3.2,这两个导出字段的原注释还明确约定在
v4.0.0 删除。外部消费者探针在 Base `48d6e696` 可以编译同一个 `ProtocolConfig` struct literal,Head
`b7c68e9e` 则分别报 `unknown field MaxServerSendMsgSize` 和 `unknown field
MaxServerRecvMsgSize`;现有 v3 用户会在没有迁移窗口的情况下直接构建失败。建议本次先保留这两个 deprecated
字段,并在初始化时把非空旧值迁移到 `TripleConfig`(明确新旧值优先级),等 v4 再删除;补充 Base/Head 外部消费者编译和旧 YAML
到 nested config 的兼容测试。
##########
server/action.go:
##########
@@ -201,11 +207,9 @@ func (svcOpts *ServiceOptions) Export() error {
common.WithToken(svcConf.Token),
common.WithParamsValue(constant.MetadataTypeKey,
svcOpts.metadataType),
- // fix https://github.com/apache/dubbo-go/issues/2176
- // TODO: remove MaxServerSendMsgSize value and
MaxServerRecvMsgSize value when version 4.0.0
- // use TripleConfig to transport arguments
- common.WithParamsValue(constant.MaxServerSendMsgSize,
protocolConf.MaxServerSendMsgSize),
- common.WithParamsValue(constant.MaxServerRecvMsgSize,
protocolConf.MaxServerRecvMsgSize),
+ // Preserve the legacy URL parameters for downstream
protocol compatibility.
+ common.WithParamsValue(constant.MaxServerSendMsgSize,
maxServerSendMsgSize),
Review Comment:
[P1] 用公开入口锁住消息大小配置的生产传播链
当前新增测试只检查字段、默认值、Clone 和 Instance 初始化,没有执行 `ServiceOptions.Export` 或真实 Triple
handler。隔离变异同时断开 `TripleConfig` attribute 与这里的 legacy URL 参数写入后,`go test .
./global ./server` 仍全部通过;但从 `dubbo.NewInstance` +
`protocol.WithTriple(WithMaxServerRecvMsgSize("1KiB"))` 启动真实服务的探针由通过变为失败,4 KiB
请求不再被拒绝。这意味着以后传播链断开仍会绿灯。请补一条公开配置入口到真实 Triple server option
的回归测试(小请求成功、超限请求失败),并断言导出 URL 中 legacy send/recv 参数的默认值、显式值和空值优先级。
--
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]