AlexStocks commented on code in PR #1017:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1017#discussion_r3740274462
##########
pkg/listener/http/http_listener.go:
##########
@@ -83,7 +83,18 @@ func (ls *HttpListenerService) Start() error {
}
func (ls *HttpListenerService) Close() error {
- return ls.srv.Close()
+ serverErr := error(nil)
+ if ls.srv != nil {
+ serverErr = ls.srv.Close()
+ }
+ filterErr := error(nil)
+ if ls.FilterChain != nil {
+ filterErr = ls.FilterChain.Close()
Review Comment:
[P1] 热刷新会遗留上一条 FilterChain 的连接
这里新增的 Close 只覆盖 listener 终止路径;生产 `HttpListenerService.Refresh` 仍然直接把
`ls.FilterChain` 替换成新 chain,没有关闭旧 chain。本 PR 又让 gRPC FilterFactory 持有长期的
connection manager 和 descriptor cache,因此每次配置热更新都会遗留上一代 socket、transport
goroutine 和缓存。我用当前 Head 的隔离探针创建带 Close 计数的 NetworkFilter,调用一次 Refresh 后计数仍为
0。建议为 Refresh 实现并发安全的 swap + drain/回收语义,并补充重复刷新及并发请求期间刷新的测试,确认旧连接和 descriptor
状态最终释放。
--
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]