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

Sync spring init actions to prevent parallel init #14371

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

AlbumenJ
Copy link
Member

What is the purpose of the change

Status: Dubbo not inited. Early trigger Dubbo invoke during Spring Application Listener init.

main thread: invoke Dubbo Reference Bean -> referenceConfig not prepared ->                                  success get not well prepared referenceConfig -> invoke -> throw config not found exception
other thread: invoke Dubbo Reference Bean -> referenceConfig not prepared -> trigger spring config listener config load -> still getting config
stack=java.lang.IllegalStateException: No application config found or it's not a valid config! Please add <dubbo:application name="..." /> to your spring config.
  at org.apache.dubbo.config.utils.ConfigValidationUtils.validateApplicationConfig(ConfigValidationUtils.java:494)
  at org.apache.dubbo.config.utils.DefaultConfigValidator.validate(DefaultConfigValidator.java:48)
  at org.apache.dubbo.config.context.AbstractConfigManager.checkDefaultAndValidateConfigs(AbstractConfigManager.java:620)
  at org.apache.dubbo.config.context.ConfigManager.checkConfigs(ConfigManager.java:302)
  at org.apache.dubbo.config.context.ConfigManager.loadConfigs(ConfigManager.java:282)
  at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.loadApplicationConfigs(DefaultApplicationDeployer.java:255)
  at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.initialize(DefaultApplicationDeployer.java:222)
  at org.apache.dubbo.config.deploy.DefaultModuleDeployer.prepare(DefaultModuleDeployer.java:638)
  at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:232)
  at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:395)
  at org.apache.dubbo.config.spring.ReferenceBean.getCallProxy(ReferenceBean.java:446)
  at org.apache.dubbo.config.spring.ReferenceBean.access$100(ReferenceBean.java:108)
  at org.apache.dubbo.config.spring.ReferenceBean$DubboReferenceLazyInitTargetSource.getTarget(ReferenceBean.java:453)
  at org.apache.dubbo.config.spring.util.LazyTargetInvocationHandler.invoke(LazyTargetInvocationHandler.java:50)

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

Copy link

sonarcloud bot commented Jun 26, 2024

@AlbumenJ
Copy link
Member Author

@CrazyHZM PTAL

@CrazyHZM
Copy link
Member

I think the user‘s listener should have a lower priority than Dubbo. Ensure that the Dubbo status is initialized.

@AlbumenJ AlbumenJ merged commit 79a1cca into apache:3.2 Jul 4, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants