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

2.8.17版本,微服务A首次调用B微服务时,为什么会加载B微服务的线程池信息 #4675

Open
beijixing511 opened this issue Jan 13, 2025 · 1 comment

Comments

@beijixing511
Copy link

背景:

  1. 微服务A首次调用微服务B,此时会有CreateMicroserviceVersionEvent事件,在微服务A中触发微服务B的元数据加载
  2. 微服务B中定义针对schemaB指定了线程池executorB,但是在微服务A中并未指定

问题:

  1. 此时微服务A中没有指定特殊线程池,但微服务A在查找schemaB的线程配置
    OperationMeta.init
    Image

  2. 微服务A因为找不到schemaB线程池配置,而抛出异常

2025-01-13 18:59:40.905 [group0-1-thread-10] ERROR - [MicroserviceVersions.java:safeSetInstances:210] - [d2dfe91a-eeab-4f57-b731-8189a524f50a] - Failed to setInstances, appId=ApperySecdSerce, microserviceName=ApperySecdServippGallecDroi****Serve.
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'healthExecutor' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:874) ~[spring-beans-5.3.34.jar!/:5.3.34]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1359) ~[spring-beans-5.3.34.jar!/:5.3.34]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.3.34.jar!/:5.3.34]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209) ~[spring-beans-5.3.34.jar!/:5.3.34]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1171) ~[spring-context-5.3.34.jar!/:5.3.34]
at org.apache.servicecomb.foundation.common.utils.BeanUtils.getBean(BeanUtils.java:139) ~[foundation-common-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.executor.ExecutorManager.findExecutorById(ExecutorManager.java:118) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.executor.ExecutorManager.findByKey(ExecutorManager.java:109) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.executor.ExecutorManager.findExecutor(ExecutorManager.java:83) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.executor.ExecutorManager.findExecutor(ExecutorManager.java:57) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.definition.OperationMeta.init(OperationMeta.java:60) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.definition.SchemaMeta.initOperationMetas(SchemaMeta.java:63) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.definition.SchemaMeta.(SchemaMeta.java:53) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.definition.MicroserviceMeta.registerSchemaMeta(MicroserviceMeta.java:122) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.definition.ServiceRegistryListener.onCreateMicroserviceVersion(ServiceRegistryListener.java:105) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.foundation.common.event.SimpleSubscriber.syncDispatch(SimpleSubscriber.java:118) ~[foundation-common-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.foundation.common.event.SimpleSubscriber.dispatchEvent(SimpleSubscriber.java:107) ~[foundation-common-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.foundation.common.event.SimpleEventBus.post(SimpleEventBus.java:74) ~[foundation-common-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersion.(MicroserviceVersion.java:58) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersions.createMicroserviceVersion(MicroserviceVersions.java:259) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersions.lambda$setInstances$1(MicroserviceVersions.java:240) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_402]
at org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx.computeIfAbsent(ConcurrentHashMapEx.java:56) ~[foundation-common-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersions.setInstances(MicroserviceVersions.java:239) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersions.safeSetInstances(MicroserviceVersions.java:207) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceVersions.pullInstances(MicroserviceVersions.java:186) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.MicroserviceManager.getOrCreateMicroserviceVersions(MicroserviceManager.java:66) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.consumer.AppManager.getOrCreateMicroserviceVersions(AppManager.java:70) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.registry.DiscoveryManager.getOrCreateMicroserviceVersions(DiscoveryManager.java:141) ~[foundation-registry-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.SCBEngine.createMicroserviceReferenceConfig(SCBEngine.java:545) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.core.SCBEngine.createMicroserviceReferenceConfig(SCBEngine.java:516) ~[java-chassis-core-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest.createRequestMeta(CseClientHttpRequest.java:184) ~[provider-springmvc-2.8.17.jar!/:2.8.17]
at org.apache.servicecomb.provider.springmvc.reference.CseClientHttpRequest.execute(CseClientHttpRequest.java:169) ~[provider-springmvc-2.8.17.jar!/:2.8.17]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:782) ~[spring-web-5.3.34.jar!/:?]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:717) ~[spring-web-5.3.34.jar!/:?]
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:637) ~[spring-web-5.3.34.jar!/:?]
at org.apache.servicecomb.provider.springmvc.reference.RestTemplateWrapper.exchange(RestTemplateWrapper.java:196) ~[provider-springmvc-2.8.17.jar!/:2.8.17]

疑问:
请帮解答下为什么需要在微服务A中查找微服务B的schemaB配置的线程池?

@liubao68
Copy link
Contributor

可以试试深入到ExecutorManager调试下。

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

No branches or pull requests

2 participants