Skip to content

The readiness status is incorrectly determined when the application starts. #23

Open
@chpengzh

Description

@chpengzh

现象

如果同时启动一个服务的两个实例,后启动的实例状态为DOWN,哪怕该实例正常启动(无端口占用,无其他启动异常,/actruator/health接口返回值为UP)

定位

try {
        String status = readinessCheckListener.getHealthCheckerStatus()
                        && readinessCheckListener.getHealthCallbackStatus() 
              ? Status.UP.toString() : Status.DOWN.toString();
        publisher.getApplication().setAppState(status);
        publisher.register();
} catch (Exception e) {
        LOGGER.info("sofa dashboard client register failed.", e);
}

其中:

  • readinessCheckListener#getHealthCheckerStatus 返回true
  • readinessCheckListener#getHealthCallbackStatus 返回false

请问一下getHealthCallbackStatus这个函数是何含义? 这里的逻辑应该如何修改?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions