[DUBBO-3746] Bugfix: infinite loop in AbstractRegistry when IOException. fix #3746#3748
[DUBBO-3746] Bugfix: infinite loop in AbstractRegistry when IOException. fix #3746#3748ralf0131 merged 3 commits intoapache:masterfrom kezhenxu94:bugfix/gh-3746
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3748 +/- ##
============================================
+ Coverage 63.55% 63.61% +0.05%
Complexity 71 71
============================================
Files 704 704
Lines 31069 31070 +1
Branches 5037 5038 +1
============================================
+ Hits 19746 19765 +19
+ Misses 9050 9034 -16
+ Partials 2273 2271 -2
Continue to review full report at Codecov.
|
|
What if other type of exception other than IOException is thrown, this might introduce the same issue. I think a safer way is to limit the number of time to retry. |
@ralf0131 how many times to retry? I think 3 is enough, what's your opinion? |
3 looks good to me. |
|
Ping @carryxyh , what's your opinion on this pull request? |
|
Sorry for coming late. @kezhenxu94 @ralf0131 I have no more comments on this pr. After my test, multiple threads read and write to the same file will not generate exceptions and will not be out of order. But we still have to consider some other special circumstances that cause the write to fail. I think we can merge this pr first, I will conduct further testing and submit an extra pr if I think we need to optimize it. |
|
@kezhenxu94 |
What is the purpose of the change
resolve #3746
When
IOExceptionis thrown inorg.apache.dubbo.registry.support.AbstractRegistry#doSaveProperties, which is usually unrecoverable (permission denied, path not exists or no free disk space) it will retry infinitely, this patch tries to resolve this issue by stop retrying whenIOExceptionoccurs.Brief changelog
org.apache.dubbo.registry.support.AbstractRegistry
Verifying this change
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false&mvn clean test-compile failsafe:integration-testto make sure unit-test and integration-test pass.