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

Check the md5 of the metadata cache file #15006

Open
wants to merge 7 commits into
base: 3.3
Choose a base branch
from

Conversation

finefuture
Copy link
Contributor

@finefuture finefuture commented Dec 20, 2024

What is the purpose of the change?

The local cache file may be damaged for various reasons, resulting in a no provider exception, check the consistency of md5 can avoid this problem.

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • 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. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 60.75%. Comparing base (6384ce5) to head (eba13a1).

Files with missing lines Patch % Lines
...gistry/client/metadata/store/MetaCacheManager.java 50.00% 1 Missing and 1 partial ⚠️
...rg/apache/dubbo/metadata/AbstractCacheManager.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15006      +/-   ##
============================================
+ Coverage     58.88%   60.75%   +1.86%     
- Complexity       12    10866   +10854     
============================================
  Files          1882     1882              
  Lines         86004    86012       +8     
  Branches      12884    12884              
============================================
+ Hits          50644    52254    +1610     
+ Misses        29835    28307    -1528     
+ Partials       5525     5451      -74     
Flag Coverage Δ
integration-tests 33.00% <64.70%> (?)
samples-tests 29.21% <64.70%> (?)
unit-tests 58.93% <82.35%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@finefuture finefuture changed the title Read remote metadata once during application execution Read remote metadata once during application runtime Dec 27, 2024
@finefuture finefuture changed the title Read remote metadata once during application runtime Check the md5 of the cache file Jan 8, 2025
@finefuture finefuture changed the title Check the md5 of the cache file Check the md5 of the metadata cache file Jan 8, 2025
@@ -212,6 +207,15 @@ public synchronized String calAndGetRevision() {
return revision;
}

public String calRevision() {
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to add a lock here to prevent concurrent modification.

BTW, please check other operation will aquire lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants