Skip to content

Commit 35fda3c

Browse files
committed
Merge branch 'main' into jdbc_fix_parser_issue
2 parents 8761f3d + 74b87dd commit 35fda3c

File tree

17 files changed

+183
-112
lines changed

17 files changed

+183
-112
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,26 @@ assignees: ''
77

88
---
99
<!--
10-
possible labels: bug,client-api-v2,jdbc-v2
10+
High Level Area Labels:
11+
- client-api-v2
12+
- client-v1
13+
- jdbc-v2
14+
15+
Specific Area Labels:
16+
- packaging
17+
- sql-parser
18+
- data-type
19+
- docs
20+
- network
21+
- performance
22+
- jdbc-metadata
23+
- jdbc-insert
24+
- jdbc-read
25+
- client-insert
26+
- client-read
27+
- client-pojo-serde
28+
- format
29+
1130
-->
1231
## Description
1332

.github/workflows/analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108108
run: |
109109
PR_ARG=''
110-
if [ ! -z $PR_NUMBER ]; then export PR_ARG="--pr $PR_NUMBER"; fi;
110+
if [ ! -z $PR_NUMBER ]; then PR_ARG="--pr $PR_NUMBER"; fi;
111111
node jacoco-report-generator.mjs ./client-v2/target/site/jacoco-aggregate/jacoco.csv client-v2-cov.md --title "Client V2 Coverage" ${PR_ARG}
112112
node jacoco-report-generator.mjs ./jdbc-v2/target/site/jacoco-aggregate/jacoco.csv jdbc-v2-cov.md --title "JDBC V2 Coverage" ${PR_ARG}
113113
node jacoco-report-generator.mjs ./clickhouse-jdbc/target/site/jacoco-aggregate/jacoco.csv jdbc-v1-cov.md --title "JDBC V1 Coverage" ${PR_ARG}

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
CHC_BRANCH: "main"
15-
CHC_VERSION: "0.8.6"
15+
# CHC_VERSION: "0.9.0"
1616
CH_VERSION: "24.8"
1717

1818
jobs:
@@ -59,9 +59,9 @@ jobs:
5959
EOF
6060
- name: Update Configuration
6161
run: |
62-
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ env.CHC_VERSION }}-SNAPSHOT|g' \
63-
-e 's|^\( <version>\).*\(</version>\)$|\1${{ env.CHC_VERSION }}-SNAPSHOT\2|' \
64-
-e 's|${parent.groupId}|com.clickhouse|g' -e 's|${project.parent.groupId}|com.clickhouse|g' '{}' \;
62+
# find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ env.CHC_VERSION }}-SNAPSHOT|g' \
63+
# -e 's|^\( <version>\).*\(</version>\)$|\1${{ env.CHC_VERSION }}-SNAPSHOT\2|' \
64+
# -e 's|${parent.groupId}|com.clickhouse|g' -e 's|${project.parent.groupId}|com.clickhouse|g' '{}' \;
6565
find . -type f -name "simplelogger.*" -exec rm -fv '{}' \;
6666
- name: Release Snapshot
6767
uses: samuelmeuli/action-maven-publish@v1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.clickhouse.client.api;
2+
3+
public class ClickHouseException extends RuntimeException {
4+
protected boolean isRetryable = false;
5+
6+
public ClickHouseException(String message) {
7+
super(message);
8+
}
9+
10+
public ClickHouseException(String message, Throwable cause) {
11+
super(message, cause);
12+
}
13+
14+
public ClickHouseException(Throwable cause) {
15+
super(cause);
16+
}
17+
public boolean isRetryable() { return isRetryable; }
18+
}

client-v2/src/main/java/com/clickhouse/client/api/Client.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ public Builder setClientNetworkBufferSize(int size) {
813813

814814
/**
815815
* Sets list of causes that should be retried on.
816-
* Default {@code [NoHttpResponse, ConnectTimeout, ConnectionRequestTimeout]}
816+
* Default {@code [NoHttpResponse, ConnectTimeout, ConnectionRequestTimeout, ServerRetryable]}
817817
* Use {@link ClientFaultCause#None} to disable retries.
818818
*
819819
* @param causes - list of causes
@@ -1464,7 +1464,8 @@ public CompletableFuture<InsertResponse> insert(String tableName,
14641464
}
14651465
}
14661466
}
1467-
throw new ClientException("Insert request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime), lastException);
1467+
LOG.warn("Insert request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime));
1468+
throw lastException;
14681469
};
14691470

14701471
return runAsyncOperation(responseSupplier, settings.getAllSettings());
@@ -1586,8 +1587,8 @@ public CompletableFuture<QueryResponse> query(String sqlQuery, Map<String, Objec
15861587
}
15871588
}
15881589
}
1589-
1590-
throw new ClientException("Query request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime), lastException);
1590+
LOG.warn("Query request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime));
1591+
throw lastException;
15911592
};
15921593

15931594
return runAsyncOperation(responseSupplier, settings.getAllSettings());

client-v2/src/main/java/com/clickhouse/client/api/ClientConfigProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public enum ClientConfigProperties {
5252

5353
SOCKET_OPERATION_TIMEOUT("socket_timeout", "0"),
5454

55-
SOCKET_RCVBUF_OPT("socket_rcvbuf", "8196"),
55+
SOCKET_RCVBUF_OPT("socket_rcvbuf", "804800"),
5656

57-
SOCKET_SNDBUF_OPT("socket_sndbuf", "8196"),
57+
SOCKET_SNDBUF_OPT("socket_sndbuf", "804800"),
5858

5959
SOCKET_REUSEADDR_OPT("socket_reuseaddr"),
6060

@@ -120,7 +120,7 @@ public enum ClientConfigProperties {
120120

121121
CLIENT_RETRY_ON_FAILURE("client_retry_on_failures",
122122
String.join(",", ClientFaultCause.NoHttpResponse.name(), ClientFaultCause.ConnectTimeout.name(),
123-
ClientFaultCause.ConnectionRequestTimeout.name())),
123+
ClientFaultCause.ConnectionRequestTimeout.name(), ClientFaultCause.ServerRetryable.name())),
124124

125125
CLIENT_NAME("client_name"),
126126

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.clickhouse.client.api;
2-
3-
public class ClientException extends RuntimeException {
4-
5-
public ClientException(String message) {
6-
super(message);
7-
}
8-
9-
public ClientException(String message, Throwable cause) {
10-
super(message, cause);
11-
}
12-
}
1+
package com.clickhouse.client.api;
2+
3+
public class ClientException extends ClickHouseException {
4+
5+
public ClientException(String message) {
6+
super(message);
7+
}
8+
9+
public ClientException(String message, Throwable cause) {
10+
super(message, cause);
11+
}
12+
}

client-v2/src/main/java/com/clickhouse/client/api/ClientFaultCause.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ public enum ClientFaultCause {
88
ConnectTimeout,
99
ConnectionRequestTimeout,
1010
SocketTimeout,
11+
ServerRetryable,
1112
}
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
package com.clickhouse.client.api;
2-
3-
public class ConnectionInitiationException extends ClientException {
4-
5-
public ConnectionInitiationException(String message) {
6-
super(message);
7-
}
8-
9-
public ConnectionInitiationException(String message, Throwable cause) {
10-
super(message, cause);
11-
}
12-
}
1+
package com.clickhouse.client.api;
2+
3+
public class ConnectionInitiationException extends ClickHouseException {
4+
5+
public ConnectionInitiationException(String message) {
6+
super(message);
7+
this.isRetryable = true;
8+
}
9+
10+
public ConnectionInitiationException(String message, Throwable cause) {
11+
super(message, cause);
12+
this.isRetryable = true;
13+
}
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.clickhouse.client.api;
2+
3+
public class DataTransferException extends ClickHouseException {
4+
5+
public DataTransferException(String message) {
6+
super(message);
7+
}
8+
9+
public DataTransferException(String message, Throwable cause) {
10+
super(message, cause);
11+
}
12+
}

0 commit comments

Comments
 (0)