Skip to content

Commit a516c8f

Browse files
committed
fix log-rethrow
Signed-off-by: Kai Huang <[email protected]>
1 parent 6a69453 commit a516c8f

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,9 @@ public void run() throws IOException, SqlParseException {
107107
long joinTimeInMilli = System.currentTimeMillis() - timeBefore;
108108
this.metaResults.setTookImMilli(joinTimeInMilli);
109109

110-
} catch (IOException e) {
111-
LOG.error("IO error during join query execution", e);
112-
throw e;
113-
} catch (SqlParseException e) {
114-
LOG.error("SQL parsing error during join query execution", e);
115-
throw e;
116110
} catch (RuntimeException e) {
117-
LOG.error("Runtime error during join query execution", e);
118111
throw new IllegalStateException("Error occurred during join query run", e);
119112
} catch (Exception e) {
120-
LOG.error("Unexpected error during join query execution", e);
121113
throw new IllegalStateException("Unexpected error occurred during join query run", e);
122114
} finally {
123115
cleanupPointInTime();
@@ -151,7 +143,7 @@ private void cleanupPointInTime() {
151143
LOG.debug("Successfully deleted PIT");
152144
} catch (RuntimeException e) {
153145
Metrics.getInstance().getNumericalMetric(MetricName.FAILED_REQ_COUNT_SYS).increment();
154-
LOG.error("Error deleting point in time: {}", e.getMessage(), e);
146+
throw new RuntimeException("Error deleting point in time: " + e.getMessage(), e);
155147
}
156148
}
157149
}

legacy/src/main/java/org/opensearch/sql/legacy/executor/join/QueryPlanElasticExecutor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ public void run() throws IOException, SqlParseException {
6565
this.metaResults.setTookImMilli(joinTimeInMilli);
6666

6767
} catch (RuntimeException e) {
68-
LOG.error("Runtime error during QueryPlan join query execution", e);
6968
throw new IllegalStateException("Error occurred during QueryPlan join query run", e);
7069
} catch (Exception e) {
71-
LOG.error("Unexpected error during QueryPlan join query execution", e);
7270
throw new IllegalStateException(
7371
"Unexpected error occurred during QueryPlan join query run", e);
7472
} finally {
@@ -105,7 +103,7 @@ private void cleanupPointInTime() {
105103
LOG.debug("Successfully deleted PIT");
106104
} catch (RuntimeException e) {
107105
Metrics.getInstance().getNumericalMetric(MetricName.FAILED_REQ_COUNT_SYS).increment();
108-
LOG.error("Error deleting point in time: {}", e.getMessage(), e);
106+
throw new RuntimeException("Error deleting point in time: " + e.getMessage(), e);
109107
}
110108
}
111109
}

0 commit comments

Comments
 (0)