yschengzi commented on code in PR #5859:
URL: https://github.com/apache/iotdb/pull/5859#discussion_r871369961


##########
server/src/main/java/org/apache/iotdb/db/sync/sender/service/TransportHandler.java:
##########
@@ -88,6 +88,7 @@ public void start() {
             SyncConstant.HEARTBEAT_DELAY_SECONDS,
             SyncConstant.HEARTBEAT_DELAY_SECONDS,
             TimeUnit.SECONDS);
+    sendHeartbeat(); // send a heartbeat immediately

Review Comment:
   It's bad for restart of IoTDB.



##########
server/src/main/java/org/apache/iotdb/db/sync/receiver/ReceiverService.java:
##########
@@ -109,12 +101,20 @@ public synchronized void stopPipeServer() throws 
PipeServerException {
     }
   }
 
+  private void checkPipe(String pipeName, String remoteIp, long createTime) 
throws IOException {
+    PipeInfo pipeInfo = receiverManager.getPipeInfo(pipeName, remoteIp, 
createTime);
+    if (pipeInfo != null && pipeInfo.getStatus().equals(PipeStatus.STOP)) {
+      startPipe(pipeName, remoteIp, createTime);
+    }
+  }
+
   /** heartbeat RPC handle */
   public synchronized SyncResponse receiveMsg(SyncRequest request) {
     SyncResponse response = new SyncResponse(ResponseType.INFO, "");
     try {
       switch (request.getType()) {

Review Comment:
   I think it's ok for cancel heartbeat.



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