mridulm commented on code in PR #3239:
URL: https://github.com/apache/celeborn/pull/3239#discussion_r2069077363


##########
common/src/main/java/org/apache/celeborn/common/network/server/TransportChannelHandler.java:
##########
@@ -152,8 +153,18 @@ public void channelInactive(ChannelHandlerContext ctx) 
throws Exception {
 
   @Override
   public void channelRead(ChannelHandlerContext ctx, Object request) throws 
Exception {
-    if (request instanceof RequestMessage && !(request instanceof Heartbeat)) {
-      requestHandler.handle((RequestMessage) request);
+    if (request instanceof RequestMessage) {
+      if (request instanceof Heartbeat) {
+        logger.debug("Received heartbeat from {}.", 
NettyUtils.getRemoteAddress(ctx.channel()));
+        if (!enableHeartbeat) {
+          // Which disables heartbeat should send heartbeat for processing 
heartbeat to avoid
+          // reading idleness of which enables heartbeat.

Review Comment:
   This is a bit confusing.
   Perhaps something like this ?
   ```suggestion
             // When heartbeat is disabled, we should still response to a 
heartbeat if peer has 
             // heartbeat enabled - to present reading idleness
   ```



##########
common/src/main/java/org/apache/celeborn/common/network/server/TransportChannelHandler.java:
##########
@@ -152,8 +153,18 @@ public void channelInactive(ChannelHandlerContext ctx) 
throws Exception {
 
   @Override
   public void channelRead(ChannelHandlerContext ctx, Object request) throws 
Exception {
-    if (request instanceof RequestMessage && !(request instanceof Heartbeat)) {
-      requestHandler.handle((RequestMessage) request);
+    if (request instanceof RequestMessage) {
+      if (request instanceof Heartbeat) {
+        logger.debug("Received heartbeat from {}.", 
NettyUtils.getRemoteAddress(ctx.channel()));
+        if (!enableHeartbeat) {
+          // Which disables heartbeat should send heartbeat for processing 
heartbeat to avoid
+          // reading idleness of which enables heartbeat.
+          requestHandler.processHeartbeat();

Review Comment:
   `processHeartbeat` always results in sending a `Heartbeat` as response (not 
`HeartbeatResponse`).
   Are we sure this does not result in both sides constantly sending 
Heartbeat's to each other ?



-- 
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]

Reply via email to