Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 3.0.6
- Operating System version: windows10
- Java version: 1.8
Steps to reproduce this issue
- 配置dubbo参数,启动qos
dubbo:
application:
qos-port: 22222
qos-enable: true
qos-accept-foreign-ip: true
- k8s集群配置readiness探针
livenessProbe:
failureThreshold: 20
httpGet:
path: /live
port: 22222
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 20
httpGet:
path: /ready
port: 22222
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
startupProbe:
failureThreshold: 20
httpGet:
path: /startup
port: 22222
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
3.容器中,使用命令行测试readiness探针返回值,永远为false
curl http://127.0.0.1:22222/ready
false
5.通过跟踪代码,发现DeployerReadinessProbe的frameworkModel.getAllApplicationModels()中,存在一个modelName为"DUBBO_INTERNAL_APPLICATION"的项目,该项目的启动状态恒为false。
package org.apache.dubbo.qos.probe.impl;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.qos.probe.ReadinessProbe;
import org.apache.dubbo.rpc.model.ApplicationModel;
import org.apache.dubbo.rpc.model.FrameworkModel;
import org.apache.dubbo.rpc.model.ModuleModel;
import java.util.List;
@Activate
public class DeployerReadinessProbe implements ReadinessProbe {
private FrameworkModel frameworkModel;
public DeployerReadinessProbe(FrameworkModel frameworkModel) {
this.frameworkModel = frameworkModel;
}
@Override
public boolean check() {
if (this.frameworkModel == null) {
this.frameworkModel = FrameworkModel.defaultModel();
}
List<ApplicationModel> applicationModels = frameworkModel.getAllApplicationModels();
for (ApplicationModel applicationModel : applicationModels) {
for (ModuleModel moduleModel : applicationModel.getModuleModels()) {
// bugfix 不判断 DUBBO_INTERNAL_APPLICATION 的 isStarted 状态
if ("DUBBO_INTERNAL_APPLICATION".equals(applicationModel.getModelName())) {
continue;
}
if (!moduleModel.getDeployer().isStarted()) {
return false;
}
}
}
return true;
}
}
目前,项目中是通过跳过该项目状态检测的方法跳过此bug,现求助社区,寻求权威的解决方法: