From a17e4f930acc8a2229a623bb085b2b0ceb5eb8cc Mon Sep 17 00:00:00 2001 From: Zhichun Wu Date: Sun, 6 Feb 2022 11:02:11 +0800 Subject: [PATCH] Fix build failures --- .github/workflows/build.yml | 2 +- .github/workflows/timezone.yml | 2 +- .../main/java/com/clickhouse/client/ClickHouseClient.java | 4 ++++ .../clickhouse/client/http/DefaultHttpConnectionTest.java | 5 ----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 487be0018..88707f70e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: clickhouse: ["21.3", "21.8", "latest"] protocol: ["http", "grpc"] fail-fast: false - name: Build against ClickHouse ${{ matrix.clickhouse }} + name: Build against ClickHouse ${{ matrix.clickhouse }} (${{ matrix.protocol }}) steps: - name: Check out Git repository uses: actions/checkout@v2 diff --git a/.github/workflows/timezone.yml b/.github/workflows/timezone.yml index eb193d7b9..7909156a0 100644 --- a/.github/workflows/timezone.yml +++ b/.github/workflows/timezone.yml @@ -34,7 +34,7 @@ jobs: serverTz: ["Asia/Chongqing", "America/Los_Angeles", "Etc/UTC", "Europe/Berlin", "Europe/Moscow"] clientTz: ["Asia/Chongqing", "America/Los_Angeles", "Etc/UTC", "Europe/Berlin", "Europe/Moscow"] fail-fast: false - name: "Test TimeZones - Server: ${{ matrix.serverTz }}, Client: ${{ matrix.clientTz }}" + name: "TimeZone(C/S): ${{ matrix.clientTz }} vs. ${{ matrix.serverTz }}" steps: - name: Check out Git repository uses: actions/checkout@v2 diff --git a/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java b/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java index c418822a9..322ed6e50 100644 --- a/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java +++ b/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java @@ -76,6 +76,8 @@ static CompletableFuture submit(Callable task) { return (boolean) ClickHouseDefaults.ASYNC.getEffectiveDefaultValue() ? CompletableFuture.supplyAsync(() -> { try { return task.call(); + } catch (ClickHouseException e) { + throw new CompletionException(e); } catch (CompletionException e) { throw e; } catch (Exception e) { @@ -88,6 +90,8 @@ static CompletableFuture submit(Callable task) { throw new CompletionException(cause); } }, getExecutorService()) : CompletableFuture.completedFuture(task.call()); + } catch (ClickHouseException e) { + throw new CompletionException(e); } catch (CompletionException e) { throw e; } catch (Exception e) { diff --git a/clickhouse-http-client/src/test/java/com/clickhouse/client/http/DefaultHttpConnectionTest.java b/clickhouse-http-client/src/test/java/com/clickhouse/client/http/DefaultHttpConnectionTest.java index c8b62b8b1..f79bfc001 100644 --- a/clickhouse-http-client/src/test/java/com/clickhouse/client/http/DefaultHttpConnectionTest.java +++ b/clickhouse-http-client/src/test/java/com/clickhouse/client/http/DefaultHttpConnectionTest.java @@ -1,10 +1,5 @@ package com.clickhouse.client.http; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; - import com.clickhouse.client.BaseIntegrationTest; import com.clickhouse.client.ClickHouseClient; import com.clickhouse.client.ClickHouseNode;