diff --git a/protocol/rpc_status.go b/protocol/rpc_status.go index 7a915f4f5a90785580663e986a31b389e4d65706..e0fc7134f15350893b99c72a3f17da051ebf6628 100644 --- a/protocol/rpc_status.go +++ b/protocol/rpc_status.go @@ -213,3 +213,8 @@ func GetBlackListInvokers(blockSize int) []Invoker { } return resultIvks[:blockSize] } + +// RemoveUrlKeyUnhealthyStatus called when event of provider unregister, delete from black list +func RemoveUrlKeyUnhealthyStatus(key string) { + invokerBlackList.Delete(key) +} diff --git a/registry/directory/directory.go b/registry/directory/directory.go index e6ae0f3bb9004f8b933d420cdd2e7561f8232b48..2c9de9ac5b85e52b95b3d716cc3c9b01a78beb53 100644 --- a/registry/directory/directory.go +++ b/registry/directory/directory.go @@ -269,6 +269,7 @@ func (dir *RegistryDirectory) uncacheInvoker(url *common.URL) protocol.Invoker { func (dir *RegistryDirectory) uncacheInvokerWithKey(key string) protocol.Invoker { logger.Debugf("service will be deleted in cache invokers: invokers key is %s!", key) + protocol.RemoveUrlKeyUnhealthyStatus(key) if cacheInvoker, ok := dir.cacheInvokersMap.Load(key); ok { dir.cacheInvokersMap.Delete(key) return cacheInvoker.(protocol.Invoker)