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

Fixed the problem that the service was offline for a long time without re-registration #10182

Merged
merged 1 commit into from Jun 22, 2022

Conversation

icodening
Copy link
Contributor

What is the purpose of the change

fix bug #10181

Brief changelog

make EventThread non-blocking to fix bug #10181

Checklist

  • Make sure there is a GitHub_issue field 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.
  • 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.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • 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 sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

Comment on lines +302 to +310
private static final ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE = Executors.newSingleThreadExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r);
thread.setName("Dubbo-CuratorWatcher-Thread");
return thread;
}
});

Copy link
Member

Choose a reason for hiding this comment

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

Replace to use org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#getSharedExecutor.

getUrl().getOrDefaultFrameworkModel().getBeanFactory()
            .getBean(FrameworkExecutorRepository.class).getSharedExecutor();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replace to use org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#getSharedExecutor.

getUrl().getOrDefaultFrameworkModel().getBeanFactory()
            .getBean(FrameworkExecutorRepository.class).getSharedExecutor();

The FrameworkExecutorRepository class is available after 3.0 branch, but my code is master branch

Copy link
Member

Choose a reason for hiding this comment

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

get. Would you please submit a pr base on 3.0 branch after this pr merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

@AlbumenJ AlbumenJ added this to the 3.0.10 milestone Jun 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2022

Codecov Report

Merging #10182 (d4e1e09) into master (9efe21a) will increase coverage by 0.35%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master   #10182      +/-   ##
============================================
+ Coverage     60.52%   60.88%   +0.35%     
- Complexity      412      448      +36     
============================================
  Files          1100     1100              
  Lines         44569    44579      +10     
  Branches       6492     6492              
============================================
+ Hits          26976    27141     +165     
+ Misses        14624    14462     -162     
- Partials       2969     2976       +7     
Impacted Files Coverage Δ
...ting/zookeeper/curator/CuratorZookeeperClient.java 69.51% <100.00%> (+1.72%) ⬆️
...dubbo/remoting/exchange/support/DefaultFuture.java 88.28% <0.00%> (-5.41%) ⬇️
...port/identifier/BaseServiceMetadataIdentifier.java 53.57% <0.00%> (-3.58%) ⬇️
...c/main/java/org/apache/dubbo/rpc/RpcException.java 80.00% <0.00%> (-3.34%) ⬇️
...org/apache/dubbo/registry/redis/RedisRegistry.java 56.92% <0.00%> (-1.13%) ⬇️
...apache/dubbo/common/extension/ExtensionLoader.java 80.00% <0.00%> (-0.42%) ⬇️
.../apache/dubbo/config/bootstrap/DubboBootstrap.java 54.47% <0.00%> (-0.16%) ⬇️
...ng/transport/dispatcher/all/AllChannelHandler.java 89.65% <0.00%> (ø)
...n/java/org/apache/dubbo/common/utils/NetUtils.java 68.81% <0.00%> (+0.32%) ⬆️
...rg/apache/dubbo/common/timer/HashedWheelTimer.java 79.72% <0.00%> (+0.34%) ⬆️
... and 27 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 9efe21a...d4e1e09. Read the comment docs.

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.

None yet

3 participants