You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/07/28 05:05:04 UTC

[GitHub] [incubator-eventmesh] lrhkobe commented on a diff in pull request #1037: [ISSUE #1035 #1036] Fix patch TCP

lrhkobe commented on code in PR #1037:
URL: https://github.com/apache/incubator-eventmesh/pull/1037#discussion_r930699445


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/session/send/UpStreamMsgContext.java:
##########
@@ -92,21 +92,26 @@ public void retry() {
             Command replyCmd = getReplyCmd(header.getCmd());
             long sendTime = System.currentTimeMillis();
 
-            EventMeshTcpSendResult sendStatus = session.upstreamMsg(header, event,
-                    createSendCallback(replyCmd, taskExecuteTime, event), startTime, taskExecuteTime);
+            retryTimes++;
 
-            if (StringUtils.equals(EventMeshTcpSendStatus.SUCCESS.name(), sendStatus.getSendStatus().name())) {
-                logger.info("pkg|eventMesh2mq|cmd={}|event={}|user={}|wait={}ms|cost={}ms", header.getCmd(), event,
+            // check session availability
+            if (session.isAvailable(event.getSubject())) {

Review Comment:
   session.isAvailable() is not suitable for use hereļ¼Œthis method was originally used to determine whether a message can be sent to a consumer session. The method contains logic as follows:
   ```
         if (!sessionContext.subscribeTopics.containsKey(topic)) {
             logger.warn("session is not available because session has not subscribe topic:{},client:{}", topic, client);
             return false;
         }
   ```



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/group/ClientSessionGroupMapping.java:
##########
@@ -133,11 +133,11 @@ public void operationComplete(ChannelFuture future) throws Exception {
             return;
         }
 
-        closeSession(session);
-
         //remove session from sessionTable
         sessionTable.remove(addr);
 
+        closeSession(session);
+

Review Comment:
   Can you describe the specific problem, I don't understand what the original way would cause.



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org