godfreyhe commented on a change in pull request #11397: [FLINK-16217] 
[sql-client] catch all exceptions to avoid SQL client crashed
URL: https://github.com/apache/flink/pull/11397#discussion_r392163257
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
 ##########
 @@ -196,8 +196,12 @@ public void open() {
                        if (line == null) {
                                continue;
                        }
-                       final Optional<SqlCommandCall> cmdCall = 
parseCommand(line);
-                       cmdCall.ifPresent(this::callCommand);
+                       try {
+                               final Optional<SqlCommandCall> cmdCall = 
parseCommand(line);
+                               cmdCall.ifPresent(this::callCommand);
+                       } catch (Throwable t) {
 
 Review comment:
   I think SQL client crashed is a terrible thing even a small problem occurs. 
For example: before 
[FLINK-16539](https://issues.apache.org/jira/browse/FLINK-16539) is fixed,  the 
client will crash even users execute this simple command: `set 
execution.parallelism = 10;` (` 10` can't be converted to Integer because there 
is a blank before `10`). We just need to print the error message to let users 
know where is the problem, and then users can continue to execute the modified 
command. Even we wrap all exceptions in the `Executor` into 
`SqlExecutionException`, there may be other bugs hidden. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to