You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/08/03 10:11:16 UTC

[GitHub] [incubator-uniffle] smallzhongfeng opened a new pull request, #121: [Improvement] Set heartBeatExecutorService as daemon thread

smallzhongfeng opened a new pull request, #121:
URL: https://github.com/apache/incubator-uniffle/pull/121

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://github.com/Tencent/Firestorm/blob/master/CONTRIBUTING.md
     2. Ensure you have added or run the appropriate tests for your PR
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]XXXX Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   When the main thread of the shuffleServer exits, the heartbeat thread should exit as well.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   More formal.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   No need.


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936651668


##########
client-mr/src/main/java/org/apache/hadoop/mapred/SortWriteBufferManager.java:
##########
@@ -321,7 +321,7 @@ ShuffleBlockInfo createShuffleBlock(SortWriteBuffer wb) {
   }
 
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("bufferManagerSend-%d"));

Review Comment:
   Got 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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203799318

   Why do we need this patch?


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203862885

   The same as `ExecutorService executor = Executors.newSingleThreadExecutor();` I think this one needs to be set to a daemon thread as well. What do you think?@jerqi


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936691155


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -61,6 +62,8 @@ public class LocalStorageManager extends SingleStorageManager {
   private final LocalStorageChecker checker;
   private List<LocalStorage> unCorruptedStorages = Lists.newArrayList();
   private final Set<String> corruptedStorages = Sets.newConcurrentHashSet();
+  private final ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   We only use this thread pool to delete the files once when the server start. I think it's no need.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936654728


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -81,7 +82,8 @@ public class LocalStorageManager extends SingleStorageManager {
     // We must make sure the order of `storageBasePaths` and `localStorages` is same, or some unit test may be fail
     CountDownLatch countDownLatch = new CountDownLatch(storageBasePaths.length);
     AtomicInteger successCount = new AtomicInteger();
-    ExecutorService executorService = Executors.newCachedThreadPool();
+    ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   Would it be better to create the thread pool when the `LocalStorageManager` is initialized.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203754397

   cc @jerqi 


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936632352


##########
client-mr/src/main/java/org/apache/hadoop/mapred/SortWriteBufferManager.java:
##########
@@ -321,7 +321,7 @@ ShuffleBlockInfo createShuffleBlock(SortWriteBuffer wb) {
   }
 
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("bufferManagerSend-%d"));

Review Comment:
   Yes, I think I made a mistake here, but I think a better way would have been to generate this executor at this object initialization. @jerqi The same as below.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936632352


##########
client-mr/src/main/java/org/apache/hadoop/mapred/SortWriteBufferManager.java:
##########
@@ -321,7 +321,7 @@ ShuffleBlockInfo createShuffleBlock(SortWriteBuffer wb) {
   }
 
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("bufferManagerSend-%d"));

Review Comment:
   Yes, I think I made a mistake here, but I think a better way would have been to generate this executor at this object initialization. @jerqi 



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng closed pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng closed pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread
URL: https://github.com/apache/incubator-uniffle/pull/121


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng closed pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng closed pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread
URL: https://github.com/apache/incubator-uniffle/pull/121


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203901091

   Reference pr you metioned, I set all unnecessary user threads as daemon.


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203785156

   # [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/121?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 [#121](https://codecov.io/gh/apache/incubator-uniffle/pull/121?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c132cda) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/fce4bb6fe48fe7db16037714bef3e47063698398?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fce4bb6) will **increase** coverage by `0.01%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #121      +/-   ##
   ============================================
   + Coverage     57.17%   57.18%   +0.01%     
     Complexity     1201     1201              
   ============================================
     Files           150      150              
     Lines          8177     8179       +2     
     Branches        773      773              
   ============================================
   + Hits           4675     4677       +2     
     Misses         3257     3257              
     Partials        245      245              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/uniffle/server/RegisterHeartBeat.java](https://codecov.io/gh/apache/incubator-uniffle/pull/121/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-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9SZWdpc3RlckhlYXJ0QmVhdC5qYXZh) | `44.64% <100.00%> (+2.05%)` | :arrow_up: |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936620909


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -81,7 +82,8 @@ public class LocalStorageManager extends SingleStorageManager {
     // We must make sure the order of `storageBasePaths` and `localStorages` is same, or some unit test may be fail
     CountDownLatch countDownLatch = new CountDownLatch(storageBasePaths.length);
     AtomicInteger successCount = new AtomicInteger();
-    ExecutorService executorService = Executors.newCachedThreadPool();
+    ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   This is a temporary thread pool. I think it's unnecessary to be a daemon thread pool.WDYT?



##########
client-mr/src/main/java/org/apache/hadoop/mapred/SortWriteBufferManager.java:
##########
@@ -321,7 +321,7 @@ ShuffleBlockInfo createShuffleBlock(SortWriteBuffer wb) {
   }
 
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("bufferManagerSend-%d"));

Review Comment:
   This is a temporary thread pool. I think it's unnecessary to be a daemon thread pool.WDYT?



##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +151,8 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   This is a temporary thread pool. I think it's unnecessary to be a daemon thread pool.WDYT?



##########
client-spark/spark3/src/main/java/org/apache/spark/shuffle/writer/RssShuffleWriter.java:
##########
@@ -244,7 +245,7 @@ protected void checkBlockSendResult(Set<Long> blockIds) throws RuntimeException
 
   @VisibleForTesting
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("sendCommit-%d"));

Review Comment:
   This is a temporary thread pool. I think it's unnecessary to be a daemon thread pool.WDYT?



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936646330


##########
client-mr/src/main/java/org/apache/hadoop/mapred/SortWriteBufferManager.java:
##########
@@ -321,7 +321,7 @@ ShuffleBlockInfo createShuffleBlock(SortWriteBuffer wb) {
   }
 
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("bufferManagerSend-%d"));

Review Comment:
   MEMORY_LOCALFILE and MEMROY_HDFS don't call commit operation, so we use a temporary thread pool. 



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936646768


##########
client-spark/spark3/src/main/java/org/apache/spark/shuffle/writer/RssShuffleWriter.java:
##########
@@ -244,7 +245,7 @@ protected void checkBlockSendResult(Set<Long> blockIds) throws RuntimeException
 
   @VisibleForTesting
   protected void sendCommit() {
-    ExecutorService executor = Executors.newSingleThreadExecutor();
+    ExecutorService executor = Executors.newSingleThreadExecutor(ThreadUtils.getThreadFactory("sendCommit-%d"));

Review Comment:
   I agree with you here, there really is no need for a daemon thread.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936702376


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -61,6 +62,8 @@ public class LocalStorageManager extends SingleStorageManager {
   private final LocalStorageChecker checker;
   private List<LocalStorage> unCorruptedStorages = Lists.newArrayList();
   private final Set<String> corruptedStorages = Sets.newConcurrentHashSet();
+  private final ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   Updated.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936764769


##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +150,7 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool();

Review Comment:
   We hope use multi-thread to call some methods, usually thread pool has specific number threads, more tasks is summited, more threads will be created util the thread number reach the max value. I guess that we just ensure multi-thread call the methods, I would like not to modify here.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936752266


##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +150,7 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool();

Review Comment:
   IIRC, a cachedThreadPool should be faster if the number of threads started is known though this is just a test class.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi merged pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi merged PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203851798

   > I'm not sure whether the main thread of the `shuffleServer` will exit unexpectedly, but is it meaningful to set the heartbeat scheduling thread as the daemon thread.
   
   Ok, have you checked similar problems in other code in our project? Could you fix them together?


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936770701


##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +150,7 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool();

Review Comment:
   Got 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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203865978

   > The same as `ExecutorService executor = Executors.newSingleThreadExecutor();` I think this one needs to be set to a daemon thread as well. What do you think?@jerqi
   
   I think we should check all types ExecutorService. A similar pr https://github.com/apache/incubator-uniffle/commit/ba47aa017f67e681af7c311c4ef8578eef740d4b


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#issuecomment-1203848870

   I'm not sure whether the main thread of the `shuffleServer` will exit unexpectedly, but is it meaningful to set the heartbeat scheduling thread as the daemon thread.


-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936706448


##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +150,7 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool();

Review Comment:
   Why do we modify this?



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] smallzhongfeng commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
smallzhongfeng commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936754053


##########
server/src/test/java/org/apache/uniffle/server/ShuffleServerMetricsTest.java:
##########
@@ -150,7 +150,7 @@ public void testGrpcMetrics() throws Exception {
 
   @Test
   public void testServerMetricsConcurrently() throws Exception {
-    ExecutorService executorService = Executors.newFixedThreadPool(3);
+    ExecutorService executorService = Executors.newCachedThreadPool();

Review Comment:
   I'm not sure why these thread numbers are needed here.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #121: [Improvement] Set heartBeatExecutorService as daemon thread

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #121:
URL: https://github.com/apache/incubator-uniffle/pull/121#discussion_r936678871


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -81,7 +82,8 @@ public class LocalStorageManager extends SingleStorageManager {
     // We must make sure the order of `storageBasePaths` and `localStorages` is same, or some unit test may be fail
     CountDownLatch countDownLatch = new CountDownLatch(storageBasePaths.length);
     AtomicInteger successCount = new AtomicInteger();
-    ExecutorService executorService = Executors.newCachedThreadPool();
+    ExecutorService executorService = Executors.newCachedThreadPool(

Review Comment:
   We only use this thread pool to delete the files once when the server start. I think it's no need.



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org