AlexStocks commented on code in PR #3645:
URL: https://github.com/apache/dubbo-go/pull/3645#discussion_r3819208582
##########
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:
[P1] 这里把已导出的 `Run(string, *tls.Config)` 改成了三参,直接破坏 v3 下游的源码兼容。固定当前 Base/Head
的外部模块对照中,相同的旧调用在 Base `b3adb336` 上 `go test` 通过,在当前 Head 上编译失败:`not enough
arguments in call to srv.Run; have (string, *tls.Config); want (string,
*tls.Config, uint32)`。epoch 是内部启动协调细节,不应要求现有消费者迁移。请保留两参 `Run`,把带 epoch
的入口改为私有方法供 `startTransport` 使用,并增加外部 consumer 编译回归。
--
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]