lizining1231 commented on code in PR #3645:
URL: https://github.com/apache/dubbo-go/pull/3645#discussion_r3836153372
##########
protocol/triple/triple_protocol/server.go:
##########
@@ -184,27 +193,47 @@ func (s *Server) SetFallbackHTTPHandler(h http.Handler) {
s.mux.SetFallbackHandler(h)
}
-func (s *Server) Run(callProtocol string, tlsConf *tls.Config) error {
+// BeginStart snapshots the startup epoch before the transport goroutine
+// runs. It must be called synchronously on the start path so Run's
+// checkpoint can detect a Stop that completes before Run reads the counter.
+func (s *Server) BeginStart() uint32 {
+ return s.stopCount.Load()
+}
+
+func (s *Server) Run(callProtocol string, tlsConf *tls.Config, epoch uint32)
error {
Review Comment:
谢谢评审!已做以下修改:
1. **公开 Run 恢复两参签名**:内部`stopCount`作为启动基础,消费者无需感知 epoch。带 epoch 的启动逻辑下沉为私有
run(string, *tls.Config, uint32):原入口检查点与单协议分支检查点逻辑原封保留
2. **新增公开 Start 封装**:同步完成启动拍照后启动传输 goroutine,外层适配层`startTransport`改为直接调用
Start
3. **`BeginStart` 私有化为 `beginStart`**:epoch 不再出现在任何公开签名中
4. **增加外部 consumer 编译回归**:新增 server_ext_test.go,以预 3640 消费者的两参调用原样编译并完成真实起停验证
--
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]