You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/09 06:03:45 UTC

[GitHub] [iotdb] RYH61 opened a new pull request, #6927: [IOTDB-4039] Unify thread-name of ClientPools

RYH61 opened a new pull request, #6927:
URL: https://github.com/apache/iotdb/pull/6927

   We can view online threads:
   Example:
   
   ![图片](https://user-images.githubusercontent.com/79885238/183575707-06e64f11-3305-4773-89e3-5088be9143cd.png)
   ![图片](https://user-images.githubusercontent.com/79885238/183575737-a88504f8-2839-43ef-a993-c35c87c6cd28.png)
   ![图片](https://user-images.githubusercontent.com/79885238/183575766-79e1cf65-7ffa-4215-a8b6-c7271b5cc55a.png)
   
   
   meanwhile
   ![图片](https://user-images.githubusercontent.com/79885238/183576054-c2b21dc9-f069-477c-ae04-28391db7eb7b.png)
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6927: [IOTDB-4039] Unify thread-name of ClientPools

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on code in PR #6927:
URL: https://github.com/apache/iotdb/pull/6927#discussion_r941115350


##########
node-commons/src/main/java/org/apache/iotdb/commons/client/AsyncBaseClientFactory.java:
##########
@@ -25,15 +25,19 @@
 
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 
 public abstract class AsyncBaseClientFactory<K, V> extends BaseClientFactory<K, V> {
 
   private static final Logger logger = LoggerFactory.getLogger(AsyncBaseClientFactory.class);
   protected TAsyncClientManager[] tManagers;
   protected AtomicInteger clientCnt = new AtomicInteger();
+  private static final String THRIFT_THREAD_NAME = "TAsyncClientManager#SelectorThread";

Review Comment:
   This is defined by ourselves, we should have the ability to name this selector thread at init.
   Instead traverse all thread to modify a name that we give to it.



-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] qiaojialin merged pull request #6927: [IOTDB-4039] Unify thread-name of ClientPools

Posted by GitBox <gi...@apache.org>.
qiaojialin merged PR #6927:
URL: https://github.com/apache/iotdb/pull/6927


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6927: [IOTDB-4039] Unify thread-name of ClientPools

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on code in PR #6927:
URL: https://github.com/apache/iotdb/pull/6927#discussion_r941087741


##########
node-commons/src/main/java/org/apache/iotdb/commons/client/AsyncBaseClientFactory.java:
##########
@@ -43,5 +47,11 @@ protected AsyncBaseClientFactory(
         logger.error("Cannot create Async client factory", e);
       }
     }
+    synchronized (this) {
+      Thread.getAllStackTraces().keySet().stream()
+          .filter(thread -> thread.getName().contains(THRIFT_THREAD_NAME))
+          .collect(Collectors.toList())
+          .forEach(thread -> thread.setName(threadName + "-" + thread.getId()));

Review Comment:
   ```suggestion
             .forEach(thread -> thread.setName(threadName  + "-selector"  + "-" + thread.getId()));
   ```



-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6927: [IOTDB-4039] Unify thread-name of ClientPools

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on code in PR #6927:
URL: https://github.com/apache/iotdb/pull/6927#discussion_r941115350


##########
node-commons/src/main/java/org/apache/iotdb/commons/client/AsyncBaseClientFactory.java:
##########
@@ -25,15 +25,19 @@
 
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 
 public abstract class AsyncBaseClientFactory<K, V> extends BaseClientFactory<K, V> {
 
   private static final Logger logger = LoggerFactory.getLogger(AsyncBaseClientFactory.class);
   protected TAsyncClientManager[] tManagers;
   protected AtomicInteger clientCnt = new AtomicInteger();
+  private static final String THRIFT_THREAD_NAME = "TAsyncClientManager#SelectorThread";

Review Comment:
   Better to investigate how to define this thread name at init.



-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] RYH61 commented on a diff in pull request #6927: [IOTDB-4039] Unify thread-name of ClientPools

Posted by GitBox <gi...@apache.org>.
RYH61 commented on code in PR #6927:
URL: https://github.com/apache/iotdb/pull/6927#discussion_r941094694


##########
node-commons/src/main/java/org/apache/iotdb/commons/client/AsyncBaseClientFactory.java:
##########
@@ -43,5 +47,11 @@ protected AsyncBaseClientFactory(
         logger.error("Cannot create Async client factory", e);
       }
     }
+    synchronized (this) {
+      Thread.getAllStackTraces().keySet().stream()
+          .filter(thread -> thread.getName().contains(THRIFT_THREAD_NAME))
+          .collect(Collectors.toList())
+          .forEach(thread -> thread.setName(threadName + "-" + thread.getId()));

Review Comment:
   fixed~



-- 
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: reviews-unsubscribe@iotdb.apache.org

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