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

Optimize retry for FailbackRegistry. #2763

Merged
merged 11 commits into from
Dec 11, 2018
Merged

Conversation

carryxyh
Copy link
Member

@carryxyh carryxyh commented Nov 8, 2018

Optimize retry for FailbackRegistry.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.

related issue:
#2752

The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.
@codecov-io
Copy link

codecov-io commented Nov 8, 2018

Codecov Report

Merging #2763 into master will decrease coverage by <.01%.
The diff coverage is 71.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2763      +/-   ##
==========================================
- Coverage   63.56%   63.56%   -0.01%     
==========================================
  Files         577      583       +6     
  Lines       25934    25964      +30     
  Branches     4543     4533      -10     
==========================================
+ Hits        16486    16504      +18     
- Misses       7290     7292       +2     
- Partials     2158     2168      +10
Impacted Files Coverage Δ
...he/dubbo/registry/zookeeper/ZookeeperRegistry.java 65.98% <ø> (ø) ⬆️
...org/apache/dubbo/registry/dubbo/DubboRegistry.java 46.15% <ø> (ø) ⬆️
...he/dubbo/registry/multicast/MulticastRegistry.java 61.2% <ø> (ø) ⬆️
...che/dubbo/registry/retry/FailedRegisteredTask.java 100% <100%> (ø)
...e/dubbo/registry/retry/FailedUnregisteredTask.java 100% <100%> (ø)
...pache/dubbo/registry/retry/FailedNotifiedTask.java 58.82% <58.82%> (ø)
...apache/dubbo/registry/retry/AbstractRetryTask.java 60% <60%> (ø)
...pache/dubbo/registry/support/FailbackRegistry.java 68.57% <73.07%> (+2.82%) ⬆️
...che/dubbo/registry/retry/FailedSubscribedTask.java 75% <75%> (ø)
...e/dubbo/registry/retry/FailedUnsubscribedTask.java 75% <75%> (ø)
... and 18 more

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 117d485...1c704be. Read the comment docs.

}

@Override
public void run(Timeout timeout) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

just override doRetry or doRun is enough. I think doRun is better(more general)

Copy link
Member

Choose a reason for hiding this comment

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

agree, I took a glance and this is the only comments I have so far. We should not re-implement run(), instead, to implement retry().

Copy link
Member Author

Choose a reason for hiding this comment

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

This is my mistake. According to the previous logic, failedNotify needs to be retried until the URL-NotifyListener key-value pair is removed.

So the logic of failedNotify is to reput to timer and retry no matter what the situation. After reading your review, I found that I can guarantee the above logic by reputing after doRetry. I will fix it as soon as possible.

}

@Override
public void run(Timeout timeout) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

agree, I took a glance and this is the only comments I have so far. We should not re-implement run(), instead, to implement retry().

@carryxyh carryxyh mentioned this pull request Nov 27, 2018
6 tasks
@beiwei30
Copy link
Member

have we reached an agreement? can I merge it now? I noticed my comment has been solved.

@beiwei30 beiwei30 merged commit 9d4b6cb into apache:master Dec 11, 2018
@carryxyh carryxyh deleted the optimize-retry branch December 12, 2018 07:59
khanimteyaz pushed a commit to khanimteyaz/incubator-dubbo that referenced this pull request Dec 17, 2018
* Abstract retry task

* Task for retry.

* Fix sth.

* Finish Optimize. fix ci failed.

* Optimize retry for FailbackRegistry.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.

* Optimize retry for FailbackRegistry.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.

* Optimize logger warn's msg.

* Optimize FailedNotifiedTask's run method.
Optimize addXXXTask, directly return if we already have a retry task.

* Optimize notify logic, just notify when the urls is not empty.

* Optimize notify logic, just notify when the urls is not empty.

* Optimize timer that use daemon thread.
beiwei30 pushed a commit that referenced this pull request Dec 17, 2018
* added dubbo-rpc-api filter documentation for issue no #2935

* wrong @see java.io.File was added, removed this version of checkins

* Close all ports after tests finish (#2906)

* fix testCustomExecutor (#2904)

* Graceful shutdown enhancement in Spring (#2901)

* Simplify the code logic of the method AbstractClusterInvoker#reselect. (#2826)

* Simplify the code logic of the method AbstractClusterInvoker#reselect.

* Minor modification for code style.

* create AbstractRouter (#2909)

* create AbstractRouter

* router default method

* router default method

* router default method

* mockinvoker

* Added javadoc for dubbo-filter module dubbo github issue 2884 (#2921)

* Enhance unit test (#2920)

* Change Readme dubbo-sample hyperlink (#2927)

* Simply TagRouter (#2924)

* make telnet config work again (#2925)

* Remove the log to putRandomPort when one protocol use random port (#2931)

* optimize findConfigedPorts method of ServiceConfig to log only one time when userandom port

* move the log to method putRandomPort

* Fix DubboShutdownHook Memory Leak (#2922)

* Improve UT grammar and remove unnecessary braces. (#2930)

* Improve UT grammer, fix compiler warnings.

* Remove unnecessary braces.

* re-enable testCustomExecutor  (#2917)

* fix testCustomExecutor

* fix ci

* Fixing test-order dependency for FstObjectInputTest (#2815)

* re-enable testCustomExecutor (#2913)

* Resetting ExtensionLoader to remove test order dependencies in StickyTest (#2807)

* optimize the RondRobinLoadBalance and MockClusterInvoker (#2932)

delete unused logic and take the logger out.

* [Dubbo-2864] Fix build failed with -Prelease (#2923)

fixes #2864

* Fix telnet can not find method with enum type (#2803)

* [dubbo-2766] fix the bug of isMatch method of InvokeTelnetHandler (#2787)

* enhance org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler#isMatch (#2941)

* enhance isMatch

* remove useless imports

* [Dubbo-2766]Fix 2766 and enhance the invoke command (#2801)

* add getter and setter for ServiceConfig's interfaceName property#2353

* add interfaceName to ignoreAttributeNames and change the unit test

* delete the demo source code and update the unit test

* unchange ServiceConfig

* update unit test

* update unit test

* fix #2798 and enhance invoke command

* Delete useless assignments (#2939)

* Replace anonymous class with method reference (#2929)

* Replace anonymous class with method reference

* Revert changes as per @beiwei30 code review

* Optimize retry for FailbackRegistry. (#2763)

* Abstract retry task

* Task for retry.

* Fix sth.

* Finish Optimize. fix ci failed.

* Optimize retry for FailbackRegistry.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.

* Optimize retry for FailbackRegistry.
The retry operation splits into specific operations, such as subscriptions and registrations. This approach allows for very precise retry control.

* Optimize logger warn's msg.

* Optimize FailedNotifiedTask's run method.
Optimize addXXXTask, directly return if we already have a retry task.

* Optimize notify logic, just notify when the urls is not empty.

* Optimize notify logic, just notify when the urls is not empty.

* Optimize timer that use daemon thread.

* standardize semantics of all mergers,enhance mergeFactory and testcase (#2936)

* Modified to lower camel case (#2945)

* Improve several map iteration (#2938)

* added dubbo-rpc-api filter documentation for issue no #2935

* wrong @see java.io.File was added, removed this version of checkins
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.

5 participants