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

Add configurable for GrpcClient health check retry times #9056

Merged

Conversation

karsonto
Copy link
Contributor

Fix the issue #9013

添加GrpcClient健康检查可重试机制

e.g. nacos.remote.client.grpc.health.retry
nacos.remote.client.grpc.health.timeout

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

XXXXX

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2022

Codecov Report

Merging #9056 (abd69f8) into develop (30794c4) will increase coverage by 0.06%.
The diff coverage is 56.52%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #9056      +/-   ##
=============================================
+ Coverage      43.66%   43.72%   +0.06%     
- Complexity      4776     4785       +9     
=============================================
  Files            912      913       +1     
  Lines          32599    32620      +21     
  Branches        3765     3769       +4     
=============================================
+ Hits           14233    14263      +30     
+ Misses         16963    16953      -10     
- Partials        1403     1404       +1     
Impacted Files Coverage Δ
...s/common/remote/client/grpc/GrpcClusterClient.java 50.00% <0.00%> (ø)
...nacos/common/remote/client/grpc/GrpcSdkClient.java 50.00% <0.00%> (ø)
.../alibaba/nacos/common/remote/client/RpcClient.java 36.94% <51.85%> (+1.63%) ⬆️
...ba/nacos/common/remote/client/grpc/GrpcClient.java 25.00% <55.55%> (+1.72%) ⬆️
...ba/nacos/common/remote/client/grpc/GrpcConsts.java 76.92% <76.92%> (ø)
...a/nacos/core/remote/control/TpsMonitorManager.java 55.84% <0.00%> (+1.29%) ⬆️
...m/alibaba/nacos/naming/misc/HttpClientManager.java 83.33% <0.00%> (+14.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30794c4...abd69f8. Read the comment docs.

@@ -103,22 +111,17 @@ public GrpcClient(String name) {

public GrpcClient(String name, Properties configProperties) {
super(name);
initGrpcClient(configProperties);
initGrpcClient(configProperties, NACOS_CLIENT_GRPC_THREADPOOL_KEEPALIVETIME, NACOS_CLIENT_GRPC_TIMEOUT,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why list constants? If you want make them as an list or array, you can create an constant list in class or Constants

this.timeOut = Long.parseLong(configProperties.getProperty(NACOS_CLIENT_GRPC_TIMEOUT));
if (configProperties.contains(NACOS_CLIENT_GRPC_HEALTHCHECK_RETRY_TIMES)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use same way with other parameters?

@karsonto karsonto force-pushed the develop-rpcclient-healthcheck-enhancement branch from e6f0245 to 5ebc461 Compare September 1, 2022 03:23
*
* @author karsonto
*/
public class GrpcConsts {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consts --> Constants
I think full name is more readable.

@KomachiSion KomachiSion merged commit 0aa695e into alibaba:develop Sep 2, 2022
@KomachiSion KomachiSion added area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement. labels Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants