-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix #1276 after healthcheck double check success, register async #1290
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1290 +/- ##
============================================
+ Coverage 83.05% 83.13% +0.08%
- Complexity 2927 2945 +18
============================================
Files 330 331 +1
Lines 9625 9659 +34
Branches 1164 1168 +4
============================================
+ Hits 7994 8030 +36
+ Misses 1126 1120 -6
- Partials 505 509 +4 ☔ View full report in Codecov by Sentry. |
...oot/src/main/java/com/alipay/sofa/rpc/boot/extension/ProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
...oot/src/main/java/com/alipay/sofa/rpc/boot/extension/ProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
...oot/src/main/java/com/alipay/sofa/rpc/boot/extension/ProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
.../java/com/alipay/sofa/boot/actuator/extension/ProviderConfigDelayRegisterCheckerSupport.java
Outdated
Show resolved
Hide resolved
.../java/com/alipay/sofa/boot/actuator/extension/ProviderConfigDelayRegisterCheckerSupport.java
Outdated
Show resolved
Hide resolved
...configure/src/main/java/com/alipay/sofa/boot/autoconfigure/rpc/SofaRpcAutoConfiguration.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../main/java/com/alipay/sofa/boot/actuator/autoconfigure/rpc/RpcActuatorAutoConfiguration.java
Outdated
Show resolved
Hide resolved
.../main/java/com/alipay/sofa/boot/actuator/autoconfigure/rpc/RpcActuatorAutoConfiguration.java
Show resolved
Hide resolved
...in/java/com/alipay/sofa/boot/actuator/rpc/HealthCheckProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
...in/java/com/alipay/sofa/boot/actuator/rpc/HealthCheckProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
...ava/com/alipay/sofa/boot/actuator/rpc/HealthCheckProviderConfigDelayRegisterCheckerTest.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Show resolved
Hide resolved
...oot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigDelayRegisterChecker.java
Outdated
Show resolved
Hide resolved
...configure/src/main/java/com/alipay/sofa/boot/autoconfigure/rpc/SofaRpcAutoConfiguration.java
Show resolved
Hide resolved
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.
需要补充集成测试,可以参考 sofa-boot-smoke-tests-rpc 模块里用例
...utoconfigure/src/main/java/com/alipay/sofa/boot/autoconfigure/rpc/SofaBootRpcProperties.java
Outdated
Show resolved
Hide resolved
...configure/src/main/java/com/alipay/sofa/boot/autoconfigure/rpc/SofaRpcAutoConfiguration.java
Outdated
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Show resolved
Hide resolved
.../rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/container/ProviderConfigContainer.java
Outdated
Show resolved
Hide resolved
.../main/java/com/alipay/sofa/boot/actuator/autoconfigure/rpc/RpcActuatorAutoConfiguration.java
Show resolved
Hide resolved
.../java/com/alipay/sofa/boot/actuator/autoconfigure/rpc/RpcActuatorAutoConfigurationTests.java
Outdated
Show resolved
Hide resolved
...in/java/com/alipay/sofa/boot/actuator/rpc/HealthCheckProviderConfigDelayRegisterChecker.java
Show resolved
Hide resolved
2.update unit tests
2.update unit tests
1.RpcActuatorAutoConfiguration autoconf after ReadinessAutoConfiguration
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.
LGTM
…sync (sofastack#1290) * fix sofastack#1276 * fix sofastack#1276 * fix sofastack#1276 * fix sofastack#1276 * 1.RpcActuatorAutoConfiguration autoconf after ReadinessAutoConfiguration 2.update unit tests * 1.RpcActuatorAutoConfiguration autoconf after ReadinessAutoConfiguration 2.update unit tests --------- Co-authored-by: 呈铭 <[email protected]> Co-authored-by: 致节 <[email protected]>
方案
在
rpc-sofa-boot
里定义一个否允许延迟服务发布至注册中心的扩展点,然后在sofa-boot-actuator
里判断应用的健康状态,通过后再继续注册到注册中心。修复后验证
demo地址:https://github.com/wangchengming666/sofa-boot-delay-demo
需要在配置里加上这两行
我的demo验证情况如下,我有一个接口配置了延时10s发布、然后应用启动后会2s循环调用一下,理论上前4~5次都会出现
Cannot get the service address of service
的异常,之后会正常调用,控制台日志打印如下