-
Notifications
You must be signed in to change notification settings - Fork 222
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
[#1368] add flag control graceful invalid call service-center api #1369
[#1368] add flag control graceful invalid call service-center api #1369
Conversation
serviceCombServiceRegistry.setStatus(serviceCombRegistration, status.toUpperCase()); | ||
if (isOperationAllow(status)) { | ||
serviceCombServiceRegistry.setStatus(serviceCombRegistration, status.toUpperCase()); | ||
LOGGER.warn("servicecomb graceful update status success, status: " + status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是正常级别的日志,不是warn类型的日志
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
LOGGER.warn("operation is not allowed, status: " + status + ", registration_enabled: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用readiness修改状态实例状态为上线实现优雅上下线是推荐的方案之一,那这个操作就不是warn。改成info就可以了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
LOGGER.warn("servicecomb graceful update status success, status: " + status); | ||
return; | ||
} | ||
LOGGER.warn("operation is not allowed, status: " + status + ", instanceStatus: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上面nacos的评论
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
|
||
private boolean isOperationAllow(String status) { | ||
return (GovernanceProperties.GRASEFUL_STATUS_UPPER.equalsIgnoreCase(status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
圈复杂度有点搞,可以改成以下格式:
if (xxx)
return true
if (xxx)
return true
return false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
servicecomb引擎场景:
1、由于spring加载bean是无序的,某些场景服务端口就绪了,但是微服务未注册,此时实例更新不成功。
2、上线脚本存在问题时,有可能多次请求更新实例状态为UP的情况,给服务端造成不必要的压力。
nacos场景:
上线脚本存在问题时,有可能多次请求更新实例状态为UP的情况,给服务端造成不必要的压力。