Alanxtl commented on code in PR #3307:
URL: https://github.com/apache/dubbo-go/pull/3307#discussion_r3144718533
##########
protocol/base/base_protocol.go:
##########
@@ -87,13 +97,19 @@ func (bp *BaseProtocol) Refer(url *common.URL) Invoker {
// Destroy will destroy all invoker and exporter, so it only is called once.
func (bp *BaseProtocol) Destroy() {
+ // Do not hold invokersLock while calling Invoker.Destroy();
implementations may run protocol callbacks.
+ bp.invokersLock.Lock()
+ invokers := make([]Invoker, len(bp.invokers))
+ copy(invokers, bp.invokers)
+ bp.invokers = nil
Review Comment:
这里为什么是置为nil而不是[]Invoker{}
--
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]