You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/22 17:33:00 UTC

[GitHub] [dubbo] icodening opened a new pull request, #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

icodening opened a new pull request, #10200:
URL: https://github.com/apache/dubbo/pull/10200

   ## What is the purpose of the change
   fix bug #10181 
   
   ## Brief changelog
   make ``EventThread`` non-blocking to fix bug #10181 
   
   ref PR: #10182 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] icodening commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
icodening commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1172915040

   get , i have solved it, pls review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] codecov-commenter commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1163453478

   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#10200](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3bcb8da) into [3.0](https://codecov.io/gh/apache/dubbo/commit/7a33ddf93c43f9de8e45e7bc80a22a04beecf654?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a33ddf) will **decrease** coverage by `0.17%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.0   #10200      +/-   ##
   ============================================
   - Coverage     65.87%   65.69%   -0.18%     
   + Complexity      320      319       -1     
   ============================================
     Files          1231     1231              
     Lines         53560    53570      +10     
     Branches       8091     8091              
   ============================================
   - Hits          35283    35195      -88     
   - Misses        14458    14540      +82     
   - Partials       3819     3835      +16     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ting/zookeeper/curator/CuratorZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvci9DdXJhdG9yWm9va2VlcGVyQ2xpZW50LmphdmE=) | `70.64% <100.00%> (+0.44%)` | :arrow_up: |
   | [...nt/metadata/ServiceInstanceHostPortCustomizer.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvbWV0YWRhdGEvU2VydmljZUluc3RhbmNlSG9zdFBvcnRDdXN0b21pemVyLmphdmE=) | `65.78% <0.00%> (-21.06%)` | :arrow_down: |
   | [...che/dubbo/registry/client/NopServiceDiscovery.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvTm9wU2VydmljZURpc2NvdmVyeS5qYXZh) | `44.44% <0.00%> (-11.12%)` | :arrow_down: |
   | [...ian2/dubbo/AbstractHessian2FactoryInitializer.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc2VyaWFsaXphdGlvbi9kdWJiby1zZXJpYWxpemF0aW9uLWhlc3NpYW4yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc2VyaWFsaXplL2hlc3NpYW4yL2R1YmJvL0Fic3RyYWN0SGVzc2lhbjJGYWN0b3J5SW5pdGlhbGl6ZXIuamF2YQ==) | `50.00% <0.00%> (-11.12%)` | :arrow_down: |
   | [...mmon/threadpool/support/AbortPolicyWithReport.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGhyZWFkcG9vbC9zdXBwb3J0L0Fib3J0UG9saWN5V2l0aFJlcG9ydC5qYXZh) | `73.68% <0.00%> (-10.53%)` | :arrow_down: |
   | [.../remoting/transport/netty4/NettyServerHandler.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5U2VydmVySGFuZGxlci5qYXZh) | `62.79% <0.00%> (-9.31%)` | :arrow_down: |
   | [...dubbo/common/status/support/LoadStatusChecker.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc3RhdHVzL3N1cHBvcnQvTG9hZFN0YXR1c0NoZWNrZXIuamF2YQ==) | `58.33% <0.00%> (-8.34%)` | :arrow_down: |
   | [.../common/threadpool/serial/SerializingExecutor.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGhyZWFkcG9vbC9zZXJpYWwvU2VyaWFsaXppbmdFeGVjdXRvci5qYXZh) | `70.37% <0.00%> (-7.41%)` | :arrow_down: |
   | [...bo/rpc/protocol/dubbo/DecodeableRpcInvocation.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL0RlY29kZWFibGVScGNJbnZvY2F0aW9uLmphdmE=) | `70.19% <0.00%> (-6.74%)` | :arrow_down: |
   | [...ubbo/registry/client/AbstractServiceDiscovery.java](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvQWJzdHJhY3RTZXJ2aWNlRGlzY292ZXJ5LmphdmE=) | `81.81% <0.00%> (-6.62%)` | :arrow_down: |
   | ... and [26 more](https://codecov.io/gh/apache/dubbo/pull/10200/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7a33ddf...3bcb8da](https://codecov.io/gh/apache/dubbo/pull/10200?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1169438297

   If the executor cannot be managed through the executor repository, the isolated executor should be in lazy initialization mode and destroyed on shutdown.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r904626181


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,6 +357,15 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        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;
+            }
+        });
+

Review Comment:
   Replace to use `org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#getSharedExecutor`.
   
   ```java
   getUrl().getOrDefaultFrameworkModel().getBeanFactory()
               .getBean(FrameworkExecutorRepository.class).getSharedExecutor();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r912649687


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,10 +365,24 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        private static volatile ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE;
+
+        private static volatile boolean closed = false;

Review Comment:
   just check if CURATOR_WATCHER_EXECUTOR_SERVICE is null is enough?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r912569689


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,10 +365,24 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        private static volatile ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE;
+
+        private static volatile boolean closed = false;

Review Comment:
   What is this state used for?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] icodening commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
icodening commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r912585783


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,10 +365,24 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        private static volatile ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE;
+
+        private static volatile boolean closed = false;

Review Comment:
   if there is an event callback after closing, the ``null thread pool`` will be reinitialized.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] icodening commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
icodening commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1163994353

   reason not to use ``org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#getSharedExecutor``: If a lot of callbacks are retried, many temporary threads will be created.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ merged pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged PR #10200:
URL: https://github.com/apache/dubbo/pull/10200


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] icodening commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
icodening commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r912921709


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,10 +365,24 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        private static volatile ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE;
+
+        private static volatile boolean closed = false;

Review Comment:
   if only check CURATOR_WATCHER_EXECUTOR_SERVICE is null, it will be initialized when Curator is closed and event callbacks are executed concurrently



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] icodening commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
icodening commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1164542867

   if other modules reuse the same thread pool, it may delay the execution of tasks of other modules when ``Curator block retry``, just like the stack below,  the blocked threads are replaced by ``nextExecutorExecutor`` threads
   ````
   "main-EventThread" #17 daemon prio=5 os_prio=31 tid=0x00007fb4792fa000 nid=0xa203 waiting on condition [0x0000700004c0b000]
      java.lang.Thread.State: TIMED_WAITING (sleeping)
       at java.lang.Thread.sleep(Native Method)
       at java.lang.Thread.sleep(Thread.java:340)
       at java.util.concurrent.TimeUnit.sleep(TimeUnit.java:386)
       at org.apache.curator.RetryLoop$1.sleepFor(RetryLoop.java:75)
       at org.apache.curator.retry.SleepingRetry.allowRetry(SleepingRetry.java:46)
       at org.apache.curator.retry.RetryNTimes.allowRetry(RetryNTimes.java:24)
       at org.apache.curator.RetryLoop.takeException(RetryLoop.java:174)
       at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:70)
       at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100)
       at org.apache.curator.framework.imps.GetChildrenBuilderImpl.pathInForeground(GetChildrenBuilderImpl.java:228)
       at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:219)
       at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(GetChildrenBuilderImpl.java:41)
       at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient$CuratorWatcherImpl.process(CuratorZookeeperClient.java:341)
       at org.apache.curator.framework.imps.NamespaceWatcher.process(NamespaceWatcher.java:83)
       at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:533)
       at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:508)
   ````


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#issuecomment-1164005014

   > reason not to use `org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#getSharedExecutor`: If a lot of callbacks are retried, many temporary threads will be created.
   
   you can use `org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository#nextExecutorExecutor`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10200: [3.0] Fixed the problem that the service was offline for a long time without re-registration

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10200:
URL: https://github.com/apache/dubbo/pull/10200#discussion_r912424130


##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -354,10 +360,29 @@ public void nodeChanged() throws Exception {
 
     static class CuratorWatcherImpl implements CuratorWatcher {
 
+        private static volatile ExecutorService CURATOR_WATCHER_EXECUTOR_SERVICE;
+
         private CuratorFramework client;
         private volatile ChildListener childListener;
         private String path;
 
+        private static void initExecutorIfNecessary() {
+            if (CURATOR_WATCHER_EXECUTOR_SERVICE == null) {
+                synchronized (CuratorWatcherImpl.class) {
+                    if (CURATOR_WATCHER_EXECUTOR_SERVICE == null) {
+                        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;
+                            }

Review Comment:
   Replace to use `NamedThreadFactory`



##########
dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java:
##########
@@ -256,6 +259,9 @@ public ConfigItem doGetConfigItem(String path) {
     public void doClose() {
         super.close();
         client.close();
+        if (CuratorWatcherImpl.CURATOR_WATCHER_EXECUTOR_SERVICE != null) {
+            CuratorWatcherImpl.CURATOR_WATCHER_EXECUTOR_SERVICE.shutdown();
+        }

Review Comment:
   1. add lock
   2. set null to clean up env



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org