You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "nowinkeyy (via GitHub)" <gi...@apache.org> on 2023/02/04 08:29:59 UTC

[GitHub] [rocketmq] nowinkeyy commented on a diff in pull request #5887: [ISSUE #5884] Concurrent check CommitLog messages

nowinkeyy commented on code in PR #5887:
URL: https://github.com/apache/rocketmq/pull/5887#discussion_r1096502996


##########
store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java:
##########
@@ -2743,6 +2850,258 @@ public String getServiceName() {
 
     }
 
+    class MainBatchDispatchRequestService extends ServiceThread {
+
+        private final ExecutorService batchDispatchRequestExecutor;
+
+        public MainBatchDispatchRequestService() {
+            batchDispatchRequestExecutor = new ThreadPoolExecutor(
+                    DefaultMessageStore.this.getBrokerConfig().getBatchDispatchRequestThreadPoolNums(),
+                    DefaultMessageStore.this.getBrokerConfig().getBatchDispatchRequestThreadPoolNums(),
+                    1000 * 60,
+                    TimeUnit.MICROSECONDS,
+                    new LinkedBlockingQueue<>(1024),

Review Comment:
   > when runnable tasks greater than 1024, batchDispatchRequestExecutor miss RejectedExecutionHandler logic,the default RejectedExecutionHandler is right?
   
   The reason I set the value to 1024 is that I think this size is sufficient. Because a task size is 4MB. A commitlog file size of 1G can generate 256tasks. So the queue can hold 1024 tasks generated by four commitlog files. So I set the default reject policy.



-- 
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: commits-unsubscribe@rocketmq.apache.org

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