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

leonard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new cdbc3f61583 [FLINK-24735][sql-client] Catch Throwable rather than 
Exception in LocalExecutor to avoid client crash
cdbc3f61583 is described below

commit cdbc3f61583b339f508c54717a34bad16a00a681
Author: Shengkai <33114724+fsk...@users.noreply.github.com>
AuthorDate: Mon May 23 15:57:31 2022 +0800

    [FLINK-24735][sql-client] Catch Throwable rather than Exception in 
LocalExecutor to avoid client crash
    
    This closes #19773.
---
 .../flink/table/client/gateway/local/LocalExecutor.java  | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
index 3639ef8729e..1540dec8f65 100644
--- 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
+++ 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
@@ -170,8 +170,8 @@ public class LocalExecutor implements Executor {
         List<Operation> operations;
         try {
             operations = context.wrapClassLoader(() -> 
parser.parse(statement));
-        } catch (Exception e) {
-            throw new SqlExecutionException("Failed to parse statement: " + 
statement, e);
+        } catch (Throwable t) {
+            throw new SqlExecutionException("Failed to parse statement: " + 
statement, t);
         }
         if (operations.isEmpty()) {
             throw new SqlExecutionException("Failed to parse statement: " + 
statement);
@@ -207,8 +207,8 @@ public class LocalExecutor implements Executor {
                 (TableEnvironmentInternal) context.getTableEnvironment();
         try {
             return context.wrapClassLoader(() -> 
tEnv.executeInternal(operation));
-        } catch (Exception e) {
-            throw new SqlExecutionException(MESSAGE_SQL_EXECUTION_ERROR, e);
+        } catch (Throwable t) {
+            throw new SqlExecutionException(MESSAGE_SQL_EXECUTION_ERROR, t);
         }
     }
 
@@ -220,8 +220,8 @@ public class LocalExecutor implements Executor {
                 (TableEnvironmentInternal) context.getTableEnvironment();
         try {
             return context.wrapClassLoader(() -> 
tEnv.executeInternal(operations));
-        } catch (Exception e) {
-            throw new SqlExecutionException(MESSAGE_SQL_EXECUTION_ERROR, e);
+        } catch (Throwable t) {
+            throw new SqlExecutionException(MESSAGE_SQL_EXECUTION_ERROR, t);
         }
     }
 
@@ -299,8 +299,8 @@ public class LocalExecutor implements Executor {
         try {
             // this operator will also stop flink job
             result.close();
-        } catch (Exception e) {
-            throw new SqlExecutionException("Could not cancel the query 
execution", e);
+        } catch (Throwable t) {
+            throw new SqlExecutionException("Could not cancel the query 
execution", t);
         }
         resultStore.removeResult(resultId);
     }

Reply via email to