You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sh...@apache.org on 2022/08/12 02:42:42 UTC
[flink] branch master updated: [FLINK-28767][sql-gateway] Fix unstable SqlGatewayServiceITCase.testCancelOperation
This is an automated email from the ASF dual-hosted git repository.
shengkai 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 8813a5ac914 [FLINK-28767][sql-gateway] Fix unstable SqlGatewayServiceITCase.testCancelOperation
8813a5ac914 is described below
commit 8813a5ac914835ce76eeeeb39f9e0bf0e1760af3
Author: Shengkai <10...@qq.com>
AuthorDate: Wed Aug 10 15:53:15 2022 +0800
[FLINK-28767][sql-gateway] Fix unstable SqlGatewayServiceITCase.testCancelOperation
---
.../test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java | 3 +--
.../flink/table/gateway/service/operation/OperationManager.java | 6 ++++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/flink-end-to-end-tests/flink-sql-gateway-test/src/test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java b/flink-end-to-end-tests/flink-sql-gateway-test/src/test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java
index b7a4e903ffa..ed91e2552f8 100644
--- a/flink-end-to-end-tests/flink-sql-gateway-test/src/test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java
+++ b/flink-end-to-end-tests/flink-sql-gateway-test/src/test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java
@@ -62,7 +62,6 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
-import static org.apache.flink.table.catalog.hive.HiveCatalog.isEmbeddedMetastore;
import static org.apache.flink.table.endpoint.hive.HiveServer2EndpointConfigOptions.CATALOG_HIVE_CONF_DIR;
import static org.apache.flink.table.endpoint.hive.HiveServer2EndpointConfigOptions.THRIFT_PORT;
import static org.apache.flink.tests.util.TestUtils.readCsvResultFiles;
@@ -134,7 +133,7 @@ public class SqlGatewayE2ECase extends TestLogger {
.toURI()))) {
hiveConf.addResource(inputStream, HiveCatalog.HIVE_SITE_FILE);
// trigger a read from the conf so that the input stream is read
- isEmbeddedMetastore(hiveConf);
+ hiveConf.getVar(HiveConf.ConfVars.METASTOREURIS);
} catch (Exception e) {
throw new RuntimeException("Failed to load hive-site.xml from specified path", e);
}
diff --git a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java
index d001b7c3062..6ca0a28f3cb 100644
--- a/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java
+++ b/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java
@@ -238,6 +238,12 @@ public class OperationManager {
runBefore();
resultFetcher = resultSupplier.call();
runAfter();
+ } catch (InterruptedException e) {
+ // User cancel the execution.
+ LOG.error(
+ String.format(
+ "Operation %s is interrupted.", operationHandle),
+ e);
} catch (Throwable t) {
processThrowable(t);
}