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

refactor(apollo-client): Optimize the exception message when failing to retrieve configuration information. #22

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

klboke
Copy link
Contributor

@klboke klboke commented Mar 15, 2023

What's the purpose of this PR

In a k8s environment, when configuration retrieval fails due to certain issues, the current exception message is not sufficient for troubleshooting, such as the following exception:
reason: Load Apollo Config failed - appId: infra-tconfig, cluster: default, namespace: application, url: http://apollo-service-dev-apollo-configservice.apollo:8080/configs/infra-tconfig/default/application?ip=172.26.203.126 [Cause: Could not complete get operation [Cause: apollo-service-dev-apollo-configservice.apollo.]]

Finally, it was found that the issue was caused by unstable DNS resolution. The updated exception message will provide this critical information, such as:
reason: Load Apollo Config failed - appId: infra-tconfig, cluster: default, namespace: application, url: http://apollo-service-dev-apollo-configservice.apollo.:8080/configs/infra-tconfig/default/application?ip=172.26.203.126 [Cause: ApolloConfigException(Could not complete get operation) [Cause: UnknownHostException(apollo-service-dev-apollo-configservice.apollo.)]]

@klboke klboke requested a review from nobodyiam March 15, 2023 03:31
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #22 (ef4a6e7) into main (b6cc06a) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head ef4a6e7 differs from pull request most recent head bfe1c07. Consider uploading reports for the commit bfe1c07 to get more accurate results

@@             Coverage Diff              @@
##               main      #22      +/-   ##
============================================
+ Coverage     68.19%   68.22%   +0.03%     
- Complexity     1177     1178       +1     
============================================
  Files           167      167              
  Lines          5125     5130       +5     
  Branches        560      560              
============================================
+ Hits           3495     3500       +5     
  Misses         1366     1366              
  Partials        264      264              
Impacted Files Coverage Δ
...com/ctrip/framework/apollo/util/ExceptionUtil.java 92.30% <100.00%> (+1.83%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@nobodyiam nobodyiam merged commit 78ec538 into apolloconfig:main Mar 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2023
@nobodyiam nobodyiam added this to the 2.2.0 milestone Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants