Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ProtocolSecurityWrapper WIP #14937

Open
4 tasks done
vio-lin opened this issue Nov 25, 2024 · 1 comment
Open
4 tasks done

[Bug] ProtocolSecurityWrapper WIP #14937

vio-lin opened this issue Nov 25, 2024 · 1 comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@vio-lin
Copy link
Contributor

vio-lin commented Nov 25, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.2.6 linux: Linux 5.15.80
i check code in branch 3.3

Steps to reproduce this issue

deploy a dubbo reference with 2000 providers for test .
It is a 10s addition time cost when i try to update config 'timeout' in client.
these provider url when i use new code in 3.2.6 zookeeperRegistry used and last version of code.

// old code 
URL url = URL.valueOf(providerUrl)
// new code
URL url = new DubboServiceAddressURL(rawProvider.getUrlAddress(), rawProvider.getUrlParam(), copyOfConsumer, overrideUrl))

image

There are some reflection operation and do not be cached .
it is ok in export but refer process this cost will be long when 'proverider size' and 'methods length' grow

//  org.apache.dubbo.common.utils.SerializeSecurityConfigurator#registerInterface
 if (!autoTrustSerializeClass) {
            return;
        }

        Set<Type> markedClass = new HashSet<>();
        checkClass(markedClass, clazz);

        addToAllow(clazz.getName());

        Method[] methodsToExport = clazz.getMethods();

        for (Method method : methodsToExport) {
            Class<?>[] parameterTypes = method.getParameterTypes();
            for (Class<?> parameterType : parameterTypes) {
                checkClass(markedClass, parameterType);
            }

i want to know is it necessary to be fixed?
and if i work on it should it is will to use existed service cache in dubbo like ‘watch org.apache.dubbo.rpc.model.ReflectionServiceDescriptor '
or some dependency like org.springframework.util.ReflectionUtils.

What you expected to happen

there are 2000 instance in registry。
when i change timeout config in config center。
client do refrer all client to repalace this url。

expected to happen : urls update in 10s when netty client do not changed
actual : it takes more than 20 milites to update url

in my machine it take 5ms * 2000 times to process SerializeSecurityConfigurator addition

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@vio-lin vio-lin added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Nov 25, 2024
@AlbumenJ
Copy link
Member

We may can use cache here. ReflectionServiceDescriptor might be not detailed enough for security check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

2 participants