You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shenyu.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:08:00 UTC

[GitHub] [incubator-shenyu] leontius opened a new pull request #1632: fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

leontius opened a new pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632


   There is no thread name in the thread pool, which is inconvenient for debugging.
   Add the thread pool name to the thread pool of shenyu client, and increase the exception rollback of the transaction.
   
   // Describe your PR here; eg. Fixes #issueNo
   
   <!--
   Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [x] You have read the [contribution guidelines](https://dromara.org/projects/soul/contributor/).
   - [ ] You submit test cases (unit or integration tests) that back your changes.
   - [x] Your local test passed `mvn clean install -Dmaven.javadoc.skip=true`.
   


-- 
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.

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



[GitHub] [incubator-shenyu] codecov-commenter edited a comment on pull request #1632: [ISSUE #1633]fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#issuecomment-863925362


   # [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@d42a4db`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-shenyu/pull/1632/graphs/tree.svg?width=650&height=150&src=pr&token=k89XYIkOHK&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #1632   +/-   ##
   =========================================
     Coverage          ?   63.32%           
     Complexity        ?     2245           
   =========================================
     Files             ?      456           
     Lines             ?     9560           
     Branches          ?      973           
   =========================================
     Hits              ?     6054           
     Misses            ?     3016           
     Partials          ?      490           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?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/incubator-shenyu/pull/1632?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 [d42a4db...7fea64b](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?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.

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



[GitHub] [incubator-shenyu] dengliming commented on a change in pull request #1632: fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
dengliming commented on a change in pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#discussion_r654252957



##########
File path: shenyu-client/shenyu-client-dubbo/shenyu-client-alibaba-dubbo/src/main/java/org/apache/shenyu/client/alibaba/dubbo/AlibabaDubboServiceBeanListener.java
##########
@@ -78,7 +79,8 @@ public AlibabaDubboServiceBeanListener(final ShenyuRegisterCenterConfig config,
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()

Review comment:
       I'm a little confused. What's the difference between this and `java.util.concurrent.Executors#newSingleThreadExecutor(java.util.concurrent.ThreadFactory)` ?

##########
File path: shenyu-client/shenyu-client-dubbo/shenyu-client-alibaba-dubbo/src/main/java/org/apache/shenyu/client/alibaba/dubbo/AlibabaDubboServiceBeanListener.java
##########
@@ -78,7 +79,8 @@ public AlibabaDubboServiceBeanListener(final ShenyuRegisterCenterConfig config,
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()

Review comment:
       Thanks. I'm not quite sure that using only one thread is a reasonable choice. @yu199195 @tydhot 
   
   




-- 
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.

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



[GitHub] [incubator-shenyu] yu199195 commented on a change in pull request #1632: [ISSUE #1633]fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
yu199195 commented on a change in pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#discussion_r654330386



##########
File path: shenyu-client/shenyu-client-dubbo/shenyu-client-alibaba-dubbo/src/main/java/org/apache/shenyu/client/alibaba/dubbo/AlibabaDubboServiceBeanListener.java
##########
@@ -78,7 +79,8 @@ public AlibabaDubboServiceBeanListener(final ShenyuRegisterCenterConfig config,
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()

Review comment:
       .... why not used Executors.newXXXX ? 




-- 
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.

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



[GitHub] [incubator-shenyu] dengliming merged pull request #1632: [ISSUE #1633]fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
dengliming merged pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632


   


-- 
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.

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



[GitHub] [incubator-shenyu] tydhot commented on a change in pull request #1632: fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
tydhot commented on a change in pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#discussion_r654249672



##########
File path: shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceBeanPostProcessor.java
##########
@@ -75,7 +76,8 @@ public SofaServiceBeanPostProcessor(final ShenyuRegisterCenterConfig config, fin
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()
+                .setNameFormat("sofa-client-thread-pool-%d").build());

Review comment:
       if u want to add poll name, I think u must add prefix like 'shenyu-' first to avoid misunderstanding .

##########
File path: shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceBeanPostProcessor.java
##########
@@ -75,7 +76,8 @@ public SofaServiceBeanPostProcessor(final ShenyuRegisterCenterConfig config, fin
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()
+                .setNameFormat("sofa-client-thread-pool-%d").build());

Review comment:
       if u want to add pool name, I think u must add prefix like 'shenyu-' first to avoid misunderstanding .




-- 
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.

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



[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #1632: [ISSUE #1633]fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#issuecomment-863925362


   # [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@d42a4db`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-shenyu/pull/1632/graphs/tree.svg?width=650&height=150&src=pr&token=k89XYIkOHK&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #1632   +/-   ##
   =========================================
     Coverage          ?   62.78%           
     Complexity        ?     2236           
   =========================================
     Files             ?      456           
     Lines             ?     9560           
     Branches          ?      973           
   =========================================
     Hits              ?     6002           
     Misses            ?     3071           
     Partials          ?      487           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?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/incubator-shenyu/pull/1632?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 [d42a4db...7fea64b](https://codecov.io/gh/apache/incubator-shenyu/pull/1632?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.

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



[GitHub] [incubator-shenyu] leontius commented on a change in pull request #1632: fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

Posted by GitBox <gi...@apache.org>.
leontius commented on a change in pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#discussion_r654255500



##########
File path: shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceBeanPostProcessor.java
##########
@@ -75,7 +76,8 @@ public SofaServiceBeanPostProcessor(final ShenyuRegisterCenterConfig config, fin
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()
+                .setNameFormat("sofa-client-thread-pool-%d").build());

Review comment:
       ok, let me change it.

##########
File path: shenyu-client/shenyu-client-dubbo/shenyu-client-alibaba-dubbo/src/main/java/org/apache/shenyu/client/alibaba/dubbo/AlibabaDubboServiceBeanListener.java
##########
@@ -78,7 +79,8 @@ public AlibabaDubboServiceBeanListener(final ShenyuRegisterCenterConfig config,
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()

Review comment:
       Maybe someone watched alibaba p3c before.

##########
File path: shenyu-client/shenyu-client-dubbo/shenyu-client-alibaba-dubbo/src/main/java/org/apache/shenyu/client/alibaba/dubbo/AlibabaDubboServiceBeanListener.java
##########
@@ -78,7 +79,8 @@ public AlibabaDubboServiceBeanListener(final ShenyuRegisterCenterConfig config,
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()

Review comment:
       finished. please 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.

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