You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ma...@apache.org on 2022/10/28 06:46:40 UTC

[iotdb] 01/01: add log when meets exception in sub-compaction-task

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

marklau99 pushed a commit to branch add-error-log-for-subtask-0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b6ccaeb152b8254190b214da790851a88dfddac2
Author: Liu Xuxin <li...@outlook.com>
AuthorDate: Fri Oct 28 14:46:14 2022 +0800

    add log when meets exception in sub-compaction-task
---
 client-cpp/pom.xml                                 |  4 +--
 compile-tools/pom.xml                              |  6 ++--
 distribution/pom.xml                               |  2 +-
 example/client-cpp-example/pom.xml                 |  2 +-
 example/trigger/pom.xml                            |  2 +-
 example/udf/pom.xml                                |  2 +-
 grafana-connector/pom.xml                          |  2 +-
 integration/pom.xml                                |  6 ++--
 jdbc/pom.xml                                       |  2 +-
 pom.xml                                            |  8 ++---
 .../cross/rewrite/task/SubCompactionTask.java      | 37 ++++++++++++----------
 11 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/client-cpp/pom.xml b/client-cpp/pom.xml
index 6a7ac1e630..576a42cdb6 100644
--- a/client-cpp/pom.xml
+++ b/client-cpp/pom.xml
@@ -116,8 +116,8 @@
                 <cmake.root.dir>${project.parent.basedir}/compile-tools/thrift/target/cmake-${cmake-version}-win64-x64/</cmake.root.dir>
                 <thrift.exec.absolute.path>${project.parent.basedir}/compile-tools/thrift/target/build/compiler/cpp/bin/${cmake.build.type}/thrift.exe</thrift.exec.absolute.path>
                 <iotdb.server.script>start-server.bat</iotdb.server.script>
-                <boost.include.dir />
-                <boost.library.dir />
+                <boost.include.dir/>
+                <boost.library.dir/>
             </properties>
         </profile>
         <profile>
diff --git a/compile-tools/pom.xml b/compile-tools/pom.xml
index 89a525c0a5..d3e1ae34da 100644
--- a/compile-tools/pom.xml
+++ b/compile-tools/pom.xml
@@ -35,7 +35,7 @@
         <cmake-version>3.17.3</cmake-version>
         <openssl.include.dir>-Dtrue1=true1</openssl.include.dir>
         <bison.executable.dir>-Dtrue1=true1</bison.executable.dir>
-        <cmake.build.type />
+        <cmake.build.type/>
     </properties>
     <modules>
         <module>thrift</module>
@@ -138,8 +138,8 @@
                 <thrift.make.executable>make</thrift.make.executable>
                 <thrift.compiler.executable>thrift.exe</thrift.compiler.executable>
                 <gradlew.executable>gradlew.bat</gradlew.executable>
-                <boost.include.dir />
-                <boost.library.dir />
+                <boost.include.dir/>
+                <boost.library.dir/>
             </properties>
         </profile>
     </profiles>
diff --git a/distribution/pom.xml b/distribution/pom.xml
index ef29bfd121..fe4693ebf3 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -29,7 +29,7 @@
     </parent>
     <artifactId>iotdb-distribution</artifactId>
     <name>IoTDB Distribution</name>
-    <modules />
+    <modules/>
     <build>
         <plugins>
             <plugin>
diff --git a/example/client-cpp-example/pom.xml b/example/client-cpp-example/pom.xml
index c55b2bc561..463f001812 100644
--- a/example/client-cpp-example/pom.xml
+++ b/example/client-cpp-example/pom.xml
@@ -84,7 +84,7 @@
             <properties>
                 <cmake.generator>Visual Studio 16 2019</cmake.generator>
                 <cmake.root.dir>${project.parent.basedir}/../compile-tools/thrift/target/cmake-${cmake-version}-win64-x64/</cmake.root.dir>
-                <boost.include.dir />
+                <boost.include.dir/>
             </properties>
         </profile>
         <profile>
diff --git a/example/trigger/pom.xml b/example/trigger/pom.xml
index f0f694690c..b13a63f292 100644
--- a/example/trigger/pom.xml
+++ b/example/trigger/pom.xml
@@ -118,7 +118,7 @@
                                 <importOrder>
                                     <order>org.apache.iotdb,,javax,java,\#</order>
                                 </importOrder>
-                                <removeUnusedImports />
+                                <removeUnusedImports/>
                             </java>
                         </configuration>
                         <executions>
diff --git a/example/udf/pom.xml b/example/udf/pom.xml
index 37eb9ba008..fc485a3138 100644
--- a/example/udf/pom.xml
+++ b/example/udf/pom.xml
@@ -118,7 +118,7 @@
                                 <importOrder>
                                     <order>org.apache.iotdb,,javax,java,\#</order>
                                 </importOrder>
-                                <removeUnusedImports />
+                                <removeUnusedImports/>
                             </java>
                         </configuration>
                         <executions>
diff --git a/grafana-connector/pom.xml b/grafana-connector/pom.xml
index bfc397eb56..4e017662fd 100644
--- a/grafana-connector/pom.xml
+++ b/grafana-connector/pom.xml
@@ -170,7 +170,7 @@
                                     <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                         <resource>META-INF/spring.schemas</resource>
                                     </transformer>
-                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
+                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                     <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                         <mainClass>${start-class}</mainClass>
                                     </transformer>
diff --git a/integration/pom.xml b/integration/pom.xml
index 7ee33b0db2..ee0f0e8234 100644
--- a/integration/pom.xml
+++ b/integration/pom.xml
@@ -80,7 +80,7 @@
             <id>LocalStandalone</id>
             <properties>
                 <test.includedGroups>org.apache.iotdb.itbase.category.LocalStandaloneTest</test.includedGroups>
-                <test.excludedGroups />
+                <test.excludedGroups/>
             </properties>
             <activation>
                 <activeByDefault>true</activeByDefault>
@@ -142,7 +142,7 @@
             <id>Remote</id>
             <properties>
                 <test.includedGroups>org.apache.iotdb.itbase.category.RemoteTest</test.includedGroups>
-                <test.excludedGroups />
+                <test.excludedGroups/>
             </properties>
             <activation>
                 <activeByDefault>false</activeByDefault>
@@ -206,7 +206,7 @@
             <id>Cluster</id>
             <properties>
                 <test.includedGroups>org.apache.iotdb.itbase.category.ClusterTest</test.includedGroups>
-                <test.excludedGroups />
+                <test.excludedGroups/>
             </properties>
             <activation>
                 <activeByDefault>false</activeByDefault>
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index 359400dd39..697e5a1750 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -203,7 +203,7 @@
                                                 </goals>
                                             </pluginExecutionFilter>
                                             <action>
-                                                <ignore />
+                                                <ignore/>
                                             </action>
                                         </pluginExecution>
                                     </pluginExecutions>
diff --git a/pom.xml b/pom.xml
index 3166db9faf..71b12d6108 100644
--- a/pom.xml
+++ b/pom.xml
@@ -161,7 +161,7 @@
         <sonar.junit.reportPaths>target/surefire-reports,target/failsafe-reports</sonar.junit.reportPaths>
         <!-- By default, the argLine is empty-->
         <gson.version>2.8.8</gson.version>
-        <argLine />
+        <argLine/>
         <!-- whether enable compiling the cpp client-->
         <client-cpp>false</client-cpp>
         <!-- disable enforcer by default-->
@@ -695,7 +695,7 @@
                             <importOrder>
                                 <order>org.apache.iotdb,,javax,java,\#</order>
                             </importOrder>
-                            <removeUnusedImports />
+                            <removeUnusedImports/>
                         </java>
                         <lineEndings>UNIX</lineEndings>
                     </configuration>
@@ -770,7 +770,7 @@
                         <phase>validate</phase>
                         <configuration>
                             <rules>
-                                <dependencyConvergence />
+                                <dependencyConvergence/>
                             </rules>
                         </configuration>
                         <goals>
@@ -816,7 +816,7 @@
                                 </requireJavaVersion>
                                 <!-- Disabled for now as it breaks the ability to build single modules -->
                                 <!--reactorModuleConvergence/-->
-                                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies" />
+                                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies"/>
                             </rules>
                         </configuration>
                     </execution>
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/rewrite/task/SubCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/rewrite/task/SubCompactionTask.java
index f5d5278437..00e7eaa011 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/rewrite/task/SubCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/rewrite/task/SubCompactionTask.java
@@ -73,25 +73,30 @@ public class SubCompactionTask implements Callable<Void> {
 
   @Override
   public Void call() throws Exception {
-    for (String measurement : measurementList) {
-      List<IMeasurementSchema> measurementSchemas =
-          Collections.singletonList(schemaMap.get(measurement));
+    try {
+      for (String measurement : measurementList) {
+        List<IMeasurementSchema> measurementSchemas =
+            Collections.singletonList(schemaMap.get(measurement));
 
-      IBatchReader dataBatchReader =
-          CompactionUtils.constructReader(
-              device,
-              Collections.singletonList(measurement),
-              measurementSchemas,
-              schemaMap.keySet(),
-              queryContext,
-              queryDataSource,
-              false);
+        IBatchReader dataBatchReader =
+            CompactionUtils.constructReader(
+                device,
+                Collections.singletonList(measurement),
+                measurementSchemas,
+                schemaMap.keySet(),
+                queryContext,
+                queryDataSource,
+                false);
 
-      if (dataBatchReader.hasNextBatch()) {
-        compactionWriter.startMeasurement(measurementSchemas, taskId);
-        CompactionUtils.writeWithReader(compactionWriter, dataBatchReader, taskId);
-        compactionWriter.endMeasurement(taskId);
+        if (dataBatchReader.hasNextBatch()) {
+          compactionWriter.startMeasurement(measurementSchemas, taskId);
+          CompactionUtils.writeWithReader(compactionWriter, dataBatchReader, taskId);
+          compactionWriter.endMeasurement(taskId);
+        }
       }
+    } catch (Throwable t) {
+      logger.error("Meets exception when executing sub-task", t);
+      throw t;
     }
     return null;
   }