Skip to content

dubbo泛化调用完成时,调用reference.destroy()后,com.alibaba.dubbo.common.URL依然没有回收 #6676

@robin977

Description

@robin977

测试场景:
public void run(String addr,String targetMethod,String className,String version) {
GenericService object=null;
ApplicationConfig applicationConfig=new ApplicationConfig("job-consumer-application");
RegistryConfig registryConfig=new RegistryConfig();
registryConfig.setAddress(addr);
registryConfig.setProtocol("zookeeper");
applicationConfig.setRegistry(registryConfig);
ReferenceConfig reference = new ReferenceConfig();
reference.setApplication(applicationConfig);
reference.setRegistry(registryConfig);
reference.setGeneric(true);
reference.setInterface(targetObject);
reference.setVersion(version);
reference.setCheck(false);
object=reference.get();
Object result=null;
try {
result= object.$invoke(targetMethod, parameterTypes, args);
} catch (Throwable e) {
e.printStackTrace();
}finally {
reference.destroy();
}
}
此方法调用后,com.alibaba.dubbo.common.URL依然没有回收
AbstractRegistry的ConcurrentMap<URL, Map<String, List>> notified,这个集合没有remove操作,所以它一直在涨
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions