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

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

Open
chpengzh opened this issue Aug 25, 2019 · 1 comment
Labels
question Further information is requested

Comments

@chpengzh
Copy link
Member

现象

如果同时启动一个服务的两个实例,后启动的实例状态为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这个函数是何含义? 这里的逻辑应该如何修改?

@sofastack-bot sofastack-bot bot changed the title 应用启动时readiness状态判断有误 The readiness status is incorrectly determined when the application starts. Aug 25, 2019
@sofastack-bot
Copy link

sofastack-bot bot commented Aug 25, 2019

Hi @chpengzh, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

Phenomenon If two instances of a service are started at the same time, the instance state that is started later is DOWN, even if the instance starts normally (no port is occupied, no other startup exception, /actruator/health interface returns <UP> #位置java try { String status = readinessCheckListener.getHealthCheckerStatus() &amp;&amp; readinessCheckListener.getHealthCallbackStatus() ? Status.UP.toString() : Status.DOWN.toString(); publisher.getApplication().setAppState(status) ; publisher.register(); } catch (Exception e) { LOGGER.info(&quot;sofa dashboard client register failed.&quot;, e); } where: - readinessCheckListener#getHealthCheckerStatus returns true - readinessCheckListener# getHealthCallbackStatus returns false What does the getHealthCallbackStatus function mean? How should the logic here be modified?

@sofastack-bot sofastack-bot bot added the question Further information is requested label Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant