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] An instance of the subclass of RegistryConfig should be added to configsCache as the RegistryConfig class type #15016

Open
4 tasks done
youjie23 opened this issue Dec 24, 2024 · 0 comments · May be fixed by #15017
Open
4 tasks done
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@youjie23
Copy link

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

Dubbo3.2.9 Dubbo3.3.2
Jdk17

Steps to reproduce this issue

When a custom subclass of RegistryConfig is created with a simple class name different from 'RegistryConfig', it leads to an unexpected behavior where an IllegalStateException is thrown, reporting 'Registry not found:' along with the associated ID. This behavior indicates a bug because all subclasses of RegistryConfig should be recognized regardless of their simple names.

code likes below:

  public  class CustomRegistryConfig extend RegistryConfig{
    //customize code
}

What you expected to happen

When processing CustomRegistryConfig, it should be treated as an instance of the RegistryConfig class type rather than being handled specifically as the CustomRegistryConfig class. This ensures consistency with the expected type handling in the system.

Anything else

The error in the AbstractConfigManager class's addConfig method stems from its logic, which currently relies on the simple name of the provided config class. However, the correct approach should involve using the simple name of the parent class that is listed in the supportedConfigTypes. This ensures consistency and proper type handling within the configuration management system.

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

@youjie23 youjie23 added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Dec 24, 2024
@youjie23 youjie23 changed the title [Bug] When processing CustomRegistryConfig, it should be treated as an instance of the RegistryConfig class type rather than being handled specifically as the CustomRegistryConfig class [Bug] An instance of the subclass of RegistryConfig should be added to configsCache as the RegistryConfig class type Dec 24, 2024
youjie23 pushed a commit to youjie23/dubbo that referenced this issue Dec 24, 2024
… to configsCache as the RegistryConfig class type(apache#15016)
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
1 participant