You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Alanxtl (via GitHub)" <gi...@apache.org> on 2026/05/30 10:48:05 UTC
[I] [metadata] 为应用级 metadata 全局状态补充并发安全 [dubbo-go]
Alanxtl opened a new issue, #3353:
URL: https://github.com/apache/dubbo-go/issues/3353
### 背景
`#2534` 将 metadata 相关逻辑集中到 metadata 模块后,应用级 metadata 通过全局状态维护本地 `MetadataInfo`、metadata report instances 和 `MetadataService`。这个 issue 只讨论应用级 metadata 主链路的并发安全。
相关代码:
- `metadata/metadata.go`
- `metadata/info/metadata_info.go`
- `metadata/report_instance.go`
- `registry/servicediscovery/service_instances_changed_listener_impl.go`
### 当前问题
当前多处核心状态是 map,但缺少清晰同步保护:
- `registryMetadataInfo` 是全局 map
- `MetadataInfo.Services` / `exportedServiceURLs` / `subscribedServiceURLs` 是 map
- metadata report `instances` 是全局 map
- 注册、订阅、实例变更、metadata service 查询可能并发发生
这可能带来 data race、stale read、并发 map 写 panic 等问题。
### 建议
- 为 metadata 全局状态增加明确的锁或并发安全容器
- 明确 `MetadataInfo` 的并发读写模型
- 在注册、注销、订阅、取消订阅、metadata service 查询链路补充并发测试
- 使用 `go test -race` 覆盖 metadata / servicediscovery 关键路径
- 避免直接暴露可被外部修改的内部 map / slice
--
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: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [FEATURE] Add concurrency safety for application-level metadata state / 为应用级 metadata 全局状态补充并发安全 [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed issue #3353: [FEATURE] Add concurrency safety for application-level metadata state / 为应用级 metadata 全局状态补充并发安全
URL: https://github.com/apache/dubbo-go/issues/3353
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [FEATURE] Add concurrency safety for application-level metadata state / 为应用级 metadata 全局状态补充并发安全 [dubbo-go]
Posted by "jieguo-coder (via GitHub)" <gi...@apache.org>.
jieguo-coder commented on issue #3353:
URL: https://github.com/apache/dubbo-go/issues/3353#issuecomment-4582757768
Hello, may I try to do this?
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [FEATURE] Add concurrency safety for application-level metadata state / 为应用级 metadata 全局状态补充并发安全 [dubbo-go]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #3353:
URL: https://github.com/apache/dubbo-go/issues/3353#issuecomment-4797516651
close via #3367
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org