You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by lt...@apache.org on 2020/02/04 08:46:36 UTC

[incubator-iotdb] branch fix_sync_runtime_exception_for_0.9 created (now 1a9bbce)

This is an automated email from the ASF dual-hosted git repository.

lta pushed a change to branch fix_sync_runtime_exception_for_0.9
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 1a9bbce  catch runtime exception and sync schema pos bug

This branch includes the following new commits:

     new 1a9bbce  catch runtime exception and sync schema pos bug

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: catch runtime exception and sync schema pos bug

Posted by lt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lta pushed a commit to branch fix_sync_runtime_exception_for_0.9
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 1a9bbce5e82d5e1b07ec862f2d842c1014a93bed
Author: lta <li...@163.com>
AuthorDate: Tue Feb 4 16:46:12 2020 +0800

    catch runtime exception and sync schema pos bug
---
 .../iotdb/db/sync/sender/transfer/DataTransferManager.java       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/DataTransferManager.java b/server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/DataTransferManager.java
index ae93413..962225f 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/DataTransferManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/DataTransferManager.java
@@ -206,7 +206,7 @@ public class DataTransferManager implements IDataTransferManager {
     executorService.scheduleWithFixedDelay(() -> {
       try {
         syncAll();
-      } catch (SyncConnectionException | IOException | TException e) {
+      } catch (Exception e) {
         logger.error("Sync failed", e);
       }
     }, SyncConstant.SYNC_PROCESS_DELAY, SyncConstant.SYNC_PROCESS_PERIOD, TimeUnit.SECONDS);
@@ -421,11 +421,16 @@ public class DataTransferManager implements IDataTransferManager {
     try {
       if (syncSchemaLogFile.exists()) {
         try (BufferedReader br = new BufferedReader(new FileReader(syncSchemaLogFile))) {
-          return Integer.parseInt(br.readLine());
+          String pos = br.readLine();
+          if(pos != null) {
+            return Integer.parseInt(pos);
+          }
         }
       }
     } catch (IOException e) {
       logger.error("Can not find file {}", syncSchemaLogFile.getAbsoluteFile(), e);
+    } catch (NumberFormatException e){
+      logger.error("Sync schema pos is not valid", e);
     }
     return 0;
   }