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

fail fast when protocol exp #12361

Merged
merged 5 commits into from Jun 12, 2023
Merged

fail fast when protocol exp #12361

merged 5 commits into from Jun 12, 2023

Conversation

wxbty
Copy link
Member

@wxbty wxbty commented May 21, 2023

What is the purpose of the change

fix #12359
pr #12316 modifies the status when the module fails to start, thus preventing DefaultApplicationDeployer#prepareApplicationInstance from running.
In addition to exposing metadataService, prepareApplicationInstance also includes protocol extension verification. When the comsumer configures the wrong protocol, the wrong prompt is printed.

Brief changelog

There is no problem with the modification of pr #12316. We need to fail fast when building the Invoker step to verify the serialization protocol, and do not perform subsequent steps

Verifying this change

Following the steps in #12359, gives the expected result

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we prepend to do this type check at initialization time. I think this modification is in the notify process. If dirty data is wrongly written in the registry (or an updated protocol, which usually occurs in the version iteration process), this will cause the processing of this push to be directly abnormal. , causing a greater impact.

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2023

Codecov Report

Merging #12361 (10056f5) into 3.2 (1671332) will decrease coverage by 0.32%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                3.2   #12361      +/-   ##
============================================
- Coverage     69.64%   69.33%   -0.32%     
+ Complexity      341        2     -339     
============================================
  Files          3435     1622    -1813     
  Lines        161622    66857   -94765     
  Branches      27079     9802   -17277     
============================================
- Hits         112566    46356   -66210     
+ Misses        39169    16013   -23156     
+ Partials       9887     4488    -5399     

see 1936 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wxbty
Copy link
Member Author

wxbty commented May 21, 2023

Do we prepend to do this type check at initialization time. I think this modification is in the notify process. If dirty data is wrongly written in the registry (or an updated protocol, which usually occurs in the version iteration process), this will cause the processing of this push to be directly abnormal. , causing a greater impact.

[21/05/23 21:16:44:231 CST] main ERROR zookeeper.ZookeeperRegistry:  [DUBBO] Failed to notify addresses for subscribe unknown://192.168.1.2/org.apache.dubbo.springboot.demo.DemoService?application=dubbo-springboot-demo-consumer&background=false&category=providers,configurators,routers&dubbo=2.0.2&executor-management-mode=isolation&file-cache=true&interface=org.apache.dubbo.springboot.demo.DemoService&methods=sayHello,sayHelloAsync&pid=1590&protocol=unknown&qos.enable=true&qos.port=33333&release=3.2.2-SNAPSHOT&side=consumer&sticky=false&timestamp=1684674910080&unloadClusterRelated=false, cause: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing., dubbo version: 3.2.2-SNAPSHOT, current host: 192.168.1.2, error code: 1-7. This may be caused by , go to https://dubbo.apache.org/faq/1/7 to find instructions. 
org.apache.dubbo.registry.support.SkipFailbackWrapperException: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
Caused by: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
	at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:779)
	at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:786)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:575)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:549)
	at org.apache.dubbo.registry.integration.RegistryDirectory.checkProtocolValid(RegistryDirectory.java:453)
	at org.apache.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:396)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:277)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshOverrideAndInvoker(RegistryDirectory.java:218)
	at org.apache.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:194)
	at org.apache.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:533)
	at org.apache.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:376)
	at org.apache.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:365)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:306)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:88)
	at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:184)
	at org.apache.dubbo.registry.integration.RegistryDirectory.lambda$subscribe$0(RegistryDirectory.java:126)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:80)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:124)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:591)
	at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getInvoker(InterfaceCompatibleRegistryProtocol.java:58)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshInterfaceInvoker(MigrationInvoker.java:464)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:245)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:60)
	at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:249)
	at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:556)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:526)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:508)
	at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:110)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:86)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80)
	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71)
	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52)
	at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:593)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:439)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:302)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:232)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:439)
	at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:419)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:173)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:145)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
	at org.apache.dubbo.springboot.demo.consumer.ConsumerApplication.main(ConsumerApplication.java:38)

The above is the thread stack of the current protocol verification, which is located in the process ReferenceConfig.init -> ReferenceConfig.createInvoker. Before the metadata is pushed, it seems that the registration center has not yet been pushed. Where do you want the protocol validation to be?

@AlbumenJ
Copy link
Member

Do we prepend to do this type check at initialization time. I think this modification is in the notify process. If dirty data is wrongly written in the registry (or an updated protocol, which usually occurs in the version iteration process), this will cause the processing of this push to be directly abnormal. , causing a greater impact.

[21/05/23 21:16:44:231 CST] main ERROR zookeeper.ZookeeperRegistry:  [DUBBO] Failed to notify addresses for subscribe unknown://192.168.1.2/org.apache.dubbo.springboot.demo.DemoService?application=dubbo-springboot-demo-consumer&background=false&category=providers,configurators,routers&dubbo=2.0.2&executor-management-mode=isolation&file-cache=true&interface=org.apache.dubbo.springboot.demo.DemoService&methods=sayHello,sayHelloAsync&pid=1590&protocol=unknown&qos.enable=true&qos.port=33333&release=3.2.2-SNAPSHOT&side=consumer&sticky=false&timestamp=1684674910080&unloadClusterRelated=false, cause: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing., dubbo version: 3.2.2-SNAPSHOT, current host: 192.168.1.2, error code: 1-7. This may be caused by , go to https://dubbo.apache.org/faq/1/7 to find instructions. 
org.apache.dubbo.registry.support.SkipFailbackWrapperException: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
Caused by: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
	at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:779)
	at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:786)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:575)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:549)
	at org.apache.dubbo.registry.integration.RegistryDirectory.checkProtocolValid(RegistryDirectory.java:453)
	at org.apache.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:396)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:277)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshOverrideAndInvoker(RegistryDirectory.java:218)
	at org.apache.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:194)
	at org.apache.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:533)
	at org.apache.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:376)
	at org.apache.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:365)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:306)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:88)
	at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:184)
	at org.apache.dubbo.registry.integration.RegistryDirectory.lambda$subscribe$0(RegistryDirectory.java:126)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:80)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:124)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:591)
	at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getInvoker(InterfaceCompatibleRegistryProtocol.java:58)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshInterfaceInvoker(MigrationInvoker.java:464)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:245)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:60)
	at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:249)
	at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:556)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:526)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:508)
	at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:110)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:86)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80)
	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71)
	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52)
	at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:593)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:439)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:302)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:232)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:439)
	at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:419)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:173)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:145)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
	at org.apache.dubbo.springboot.demo.consumer.ConsumerApplication.main(ConsumerApplication.java:38)

The above is the thread stack of the current protocol verification, which is located in the process ReferenceConfig.init -> ReferenceConfig.createInvoker. Before the metadata is pushed, it seems that the registration center has not yet been pushed. Where do you want the protocol validation to be?

Before listen registry. In subscribe

@wxbty
Copy link
Member Author

wxbty commented May 23, 2023

Do we prepend to do this type check at initialization time. I think this modification is in the notify process. If dirty data is wrongly written in the registry (or an updated protocol, which usually occurs in the version iteration process), this will cause the processing of this push to be directly abnormal. , causing a greater impact.

[21/05/23 21:16:44:231 CST] main ERROR zookeeper.ZookeeperRegistry:  [DUBBO] Failed to notify addresses for subscribe unknown://192.168.1.2/org.apache.dubbo.springboot.demo.DemoService?application=dubbo-springboot-demo-consumer&background=false&category=providers,configurators,routers&dubbo=2.0.2&executor-management-mode=isolation&file-cache=true&interface=org.apache.dubbo.springboot.demo.DemoService&methods=sayHello,sayHelloAsync&pid=1590&protocol=unknown&qos.enable=true&qos.port=33333&release=3.2.2-SNAPSHOT&side=consumer&sticky=false&timestamp=1684674910080&unloadClusterRelated=false, cause: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing., dubbo version: 3.2.2-SNAPSHOT, current host: 192.168.1.2, error code: 1-7. This may be caused by , go to https://dubbo.apache.org/faq/1/7 to find instructions. 
org.apache.dubbo.registry.support.SkipFailbackWrapperException: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
Caused by: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name unknown, no related exception was found, please check whether related SPI module is missing.
	at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:779)
	at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:786)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:575)
	at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:549)
	at org.apache.dubbo.registry.integration.RegistryDirectory.checkProtocolValid(RegistryDirectory.java:453)
	at org.apache.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:396)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:277)
	at org.apache.dubbo.registry.integration.RegistryDirectory.refreshOverrideAndInvoker(RegistryDirectory.java:218)
	at org.apache.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:194)
	at org.apache.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:533)
	at org.apache.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:376)
	at org.apache.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:365)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:306)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:88)
	at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:184)
	at org.apache.dubbo.registry.integration.RegistryDirectory.lambda$subscribe$0(RegistryDirectory.java:126)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:80)
	at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:124)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:591)
	at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getInvoker(InterfaceCompatibleRegistryProtocol.java:58)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshInterfaceInvoker(MigrationInvoker.java:464)
	at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:245)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76)
	at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:60)
	at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:249)
	at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:556)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:526)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:508)
	at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:110)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:86)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80)
	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71)
	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52)
	at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:593)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:439)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:302)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:232)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:439)
	at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:419)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:173)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:145)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
	at org.apache.dubbo.springboot.demo.consumer.ConsumerApplication.main(ConsumerApplication.java:38)

The above is the thread stack of the current protocol verification, which is located in the process ReferenceConfig.init -> ReferenceConfig.createInvoker. Before the metadata is pushed, it seems that the registration center has not yet been pushed. Where do you want the protocol validation to be?

Before listen registry. In subscribe

ok

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.apache.dubbo.registry.support.AbstractRegistry#subscribe

@wxbty
Copy link
Member Author

wxbty commented May 29, 2023

org.apache.dubbo.registry.support.AbstractRegistry#subscribe

There are protocols such as consumer that cannot be load
image

@AlbumenJ
Copy link
Member

AlbumenJ commented Jun 2, 2023

org.apache.dubbo.registry.support.AbstractRegistry#subscribe

There are protocols such as consumer that cannot be load image

org/apache/dubbo/registry/integration/RegistryDirectory.java:393

Get protocols from queryMap

@wxbty wxbty requested a review from AlbumenJ June 3, 2023 15:07
@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Comment on lines 369 to 371
if (t instanceof SkipFailbackWrapperException) {
throw t;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is these still necessary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove it

@AlbumenJ AlbumenJ merged commit bde608e into apache:3.2 Jun 12, 2023
9 of 10 checks passed
@wxbty wxbty deleted the protocol_exp_bugfix branch January 29, 2024 11:31
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.

Error exception prompt when the protocol does not exist
3 participants