You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/12 13:19:25 UTC

[GitHub] [iotdb] yschengzi commented on a diff in pull request #5859: [IOTDB-3144][IOTDB-3130] Set the default pipe status of receiver after reboot to STOP

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: reviews-unsubscribe@iotdb.apache.org

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