apache / apache/servicecomb-java-chassis

某个服务无法调用其他服务

未关闭
#3,752 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
1.9k
派生
814
平均合并
8 天 23 小时
30 天内合并 PR
1

描述

使用 cse-solution-service-engine 2.3.63 的版本
某个服务调用其他服务时会出现这样的报错,但是其他服务正常调用时都不会走到这个断点里面
为什么这个服务调用时会触发registerSchema呢
[E]-[]-[Service Center Task [java.util.concurrent.ThreadPoolExecutor$Worker@5280cc80[State = -1, empty queue][283]]][org.apache.servicecomb.core.definition.SchemaMeta]Unhandled exception to service agency-web schema ces
[E]-[]-[Service Center Task [java.util.concurrent.ThreadPoolExecutor$Worker@5280cc80[State = -1, empty queue][283]]][org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions]Failed to setInstances, appId=nontax, microserviceName=agency-web. java.lang.NullPointerException
at org.apache.servicecomb.common.javassist.CtType.(CtType.java:52)
at org.apache.servicecomb.common.javassist.MethodConfig.setResult(MethodConfig.java:64)
at org.apache.servicecomb.swagger.converter.SwaggerToClassGenerator.convertToInterface(SwaggerToClassGenerator.java:222)
at org.apache.servicecomb.swagger.converter.SwaggerToClassGenerator.convert(SwaggerToClassGenerator.java:144)
at org.apache.servicecomb.core.definition.SchemaMeta.(SchemaMeta.java:70)
at org.apache.servicecomb.core.definition.loader.SchemaLoader.registerSchema(SchemaLoader.java:85)
at org.apache.servicecomb.core.definition.schema.ConsumerSchemaFactory.createSchema(ConsumerSchemaFactory.java:61)
at org.apache.servicecomb.core.definition.schema.ConsumerSchemaFactory.createSchema(ConsumerSchemaFactory.java:33)
at org.apache.servicecomb.core.definition.schema.AbstractSchemaFactory.getOrCreateSchema(AbstractSchemaFactory.java:58)
at org.apache.servicecomb.core.definition.schema.ConsumerSchemaFactory.createConsumerSchema(ConsumerSchemaFactory.java:48)
at org.apache.servicecomb.core.definition.MicroserviceVersionMeta.(MicroserviceVersionMeta.java:45)
at org.apache.servicecomb.core.definition.MicroserviceVersionMetaFactory.create(MicroserviceVersionMetaFactory.java:38)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions.lambda$setInstances$0(MicroserviceVersions.java:184)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx.computeIfAbsent(ConcurrentHashMapEx.java:56)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions.setInstances(MicroserviceVersions.java:183)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions.safeSetInstances(MicroserviceVersions.java:163)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions.pullInstances(MicroserviceVersions.java:158)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceVersions.submitPull(MicroserviceVersions.java:130)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceManager.refreshInstances(MicroserviceManager.java:96)
at org.apache.servicecomb.serviceregistry.consumer.MicroserviceManager.periodicPull(MicroserviceManager.java:86)
at org.apache.servicecomb.foundation.common.event.SimpleSubscriber.syncDispatch(SimpleSubscriber.java:85)
at org.apache.servicecomb.foundation.common.event.SimpleSubscriber.dispatchEvent(SimpleSubscriber.java:77)
at org.apache.servicecomb.foundation.common.event.SimpleEventBus.post(SimpleEventBus.java:72)
at org.apache.servicecomb.serviceregistry.registry.RemoteServiceRegistry.lambda$run$2(RemoteServiceRegistry.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
at org.apache.servicecomb.serviceregistry.registry.RemoteServiceRegistry$1.run(RemoteServiceRegistry.java:62)

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 SchemaLoader.registerSchema 开始,跟踪经过 ConsumerSchemaFactory、SchemaMeta、SwaggerToClassGenerator、MethodConfig 和 CtType 的 consumer-schema 路径。使用 cse-solution-service-engine 2.3.63 重现该故障,并检查为什么 registerSchema 在服务发现期间会触发 NullPointerException。确定原因,并提供经过验证的修复或回归测试后,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend, distributed-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。