Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.x

Operating System version: *

Java version: *

Steps to reproduce this issue

由AbstractProxyProtocol创建的invoker在调用destroy()销毁后，因为其destroy方法并不会清理资源，所以AbstractProtocol.invokers依然会持有该invoker的引用（invoker创建时会被添加到AbstractProtocol.invokers中）。

protected <T> Invoker<T> protocolBindingRefer(final Class<T> type, final URL url) throws RpcException {
final Invoker<T> target = proxyFactory.getInvoker(doRefer(type, url), type, url);
// AbstractInvoker.destroy方法只会更新isDestroyed字段，不会清理资源
Invoker<T> invoker = new AbstractInvoker<T>(type, url) {
@Override
protected Result doInvoke(Invocation invocation) throws Throwable {
try {
Result result = target.invoke(invocation);
// FIXME result is an AsyncRpcResult instance.
Throwable e = result.getException();
if (e != null) {
for (Class<?> rpcException : rpcExceptions) {
if (rpcException.isAssignableFrom(e.getClass())) {
throw getRpcException(type, url, invocation, e);
}
}
}
return result;
} catch (RpcException e) {
if (e.getCode() == RpcException.UNKNOWN_EXCEPTION) {
e.setCode(getErrorCode(e.getCause()));
}
throw e;
} catch (Throwable e) {
throw getRpcException(type, url, invocation, e);
}
}
};
// invoker会保存所有新建的invoker
invokers.add(invoker);
return invoker;
}

而DobboProtocol创建的invoker销毁时则会清除invokers中的引用：

public void destroy() {
// in order to avoid closing a client multiple times, a counter is used in case of connection per jvm, every
// time when client.close() is called, counter counts down once, and when counter reaches zero, client will be
// closed.
if (super.isDestroyed()) {
return;
} else {
// double check to avoid dup close
destroyLock.lock();
try {
if (super.isDestroyed()) {
return;
}
super.destroy();
// 从invokers中删除
if (invokers != null) {
invokers.remove(this);
}
for (ExchangeClient client : clients) {
try {
client.close(ConfigurationUtils.getServerShutdownTimeout());
} catch (Throwable t) {
logger.warn(t.getMessage(), t);
}
}

} finally {
destroyLock.unlock();
}
}
}

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

当invoker.destroy方法调用后，则该invoker应该从AbstractProtocol.invokers中remove掉（例如DubboInvoker的做法）。

Actual Result

由于destroy方法中未将invoker从AbstractProtocol.invokers中删除，则会导致销毁的invoker无法被GC，内存泄漏

If there is an exception, please attach the exception trace:

Just put your stack trace here!

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.8

Operating System version: macOs Catalina 10.15.7

Java version: 1.8.0_231

Steps to reproduce this issue

config two registries in a dubbo project and set one(zk1) of the two to be default

`

<dubbo:registry id="zk1" address="zookeeper://localhost:2181" default="true"/>

<dubbo:registry id="zk2" address="zookeeper://localhost:2182"/>

`

export a service through @DubboService without config the registry

`

@DubboService(version = "1.0.0")

public class GreetingServiceImpl implements org.apache.dubbo.springboot.api.GreetingService {

public String sayHello(String name) {
System.out.println("greeting service received: " + name);
return "hello, " + name;
}

}`

Expected Result

the service without config registry should only be registered to the default registry(zk1) and not registered to annother registry(zk2)

Actual Result

What actually happens?

the service was registered to both two registries