pandaapo commented on code in PR #4679:
URL: https://github.com/apache/eventmesh/pull/4679#discussion_r1431177811


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/boot/TCPThreadPoolGroup.java:
##########
@@ -45,9 +48,27 @@ public void initThreadPool() {
         taskHandleExecutorService = ThreadPoolFactory.createThreadPoolExecutor(
             
eventMeshTCPConfiguration.getEventMeshTcpTaskHandleExecutorPoolSize(),
             
eventMeshTCPConfiguration.getEventMeshTcpTaskHandleExecutorPoolSize(),
-            new LinkedBlockingQueue<>(10_000),
+            new 
LinkedBlockingQueue<>(eventMeshTCPConfiguration.getEventMeshTcpTaskHandleExecutorQueueSize()),
             new EventMeshThreadFactory("eventMesh-tcp-task-handle", true));
 
+        sendExecutorService = ThreadPoolFactory.createThreadPoolExecutor(
+            eventMeshTCPConfiguration.getEventMeshTcpMsgSendExecutorPoolSize(),
+            eventMeshTCPConfiguration.getEventMeshTcpMsgSendExecutorPoolSize(),
+            new 
LinkedBlockingQueue<>(eventMeshTCPConfiguration.getEventMeshTcpMsgSendExecutorQueueSize()),
+            new EventMeshThreadFactory("eventMesh-tcp-msg-send", true));
+
+        replyExecutorService = ThreadPoolFactory.createThreadPoolExecutor(
+            
eventMeshTCPConfiguration.getEventMeshTcpMsgReplyExecutorPoolSize(),
+            
eventMeshTCPConfiguration.getEventMeshTcpMsgReplyExecutorPoolSize(),
+            new 
LinkedBlockingQueue<>(eventMeshTCPConfiguration.getEventMeshTcpMsgReplyExecutorQueueSize()),
+            new EventMeshThreadFactory("eventMesh-tcp-msg-reply", true));
+
+        ackExecutorService = ThreadPoolFactory.createThreadPoolExecutor(
+            eventMeshTCPConfiguration.getEventMeshTcpMsgAckExecutorPoolSize(),
+            eventMeshTCPConfiguration.getEventMeshTcpMsgAckExecutorPoolSize(),
+            new 
LinkedBlockingQueue<>(eventMeshTCPConfiguration.getEventMeshTcpMsgAckExecutorQueueSize()),
+            new EventMeshThreadFactory("eventMesh-tcp-msg-ack", true));
+
         broadcastMsgDownstreamExecutorService = 
ThreadPoolFactory.createThreadPoolExecutor(

Review Comment:
   Can we change the queue length from a hard-coded value to a configurable 
value for this ExecutorService, like that of ExecutorServices above?



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientSessionGroupMapping.java:
##########
@@ -167,12 +167,20 @@ private void closeSession(Session session) throws 
Exception {
 
             session.setSessionState(SessionState.CLOSED);
 
-            if 
(EventMeshConstants.PURPOSE_SUB.equals(session.getClient().getPurpose())) {
-                cleanClientGroupWrapperByCloseSub(session);
-            } else if 
(EventMeshConstants.PURPOSE_PUB.equals(session.getClient().getPurpose())) {
-                cleanClientGroupWrapperByClosePub(session);
-            } else {
-                log.error("client purpose config is error:{}", 
session.getClient().getPurpose());
+            final String clientGroup = session.getClient().getGroup();
+            if (!lockMap.containsKey(clientGroup)) {
+               lockMap.putIfAbsent(clientGroup, new Object());

Review Comment:
   Can `if (!lockMap.containsKey(clientGroup))` be omitted 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to