Skip to content

Commit 122fc96

Browse files
committed
Merge branch 'main' into jdbc_fix_json_issues
2 parents e554769 + 5c99223 commit 122fc96

File tree

17 files changed

+185
-116
lines changed

17 files changed

+185
-116
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ jobs:
107107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108108
run: |
109109
PR_ARG=''
110-
if [ ! -z $PR_NUMBER ]; then RP_ARG="--pr $PR_NUMBER"; fi;
111-
echo $PR_ARG
110+
if [ ! -z $PR_NUMBER ]; then PR_ARG="--pr $PR_NUMBER"; fi;
112111
node jacoco-report-generator.mjs ./client-v2/target/site/jacoco-aggregate/jacoco.csv client-v2-cov.md --title "Client V2 Coverage" ${PR_ARG}
113112
node jacoco-report-generator.mjs ./jdbc-v2/target/site/jacoco-aggregate/jacoco.csv jdbc-v2-cov.md --title "JDBC V2 Coverage" ${PR_ARG}
114113
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
@@ -814,7 +814,7 @@ public Builder setClientNetworkBufferSize(int size) {
814814

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

14691470
return runAsyncOperation(responseSupplier, settings.getAllSettings());
@@ -1584,8 +1585,8 @@ public CompletableFuture<QueryResponse> query(String sqlQuery, Map<String, Objec
15841585
}
15851586
}
15861587
}
1587-
1588-
throw new ClientException("Query request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime), lastException);
1588+
LOG.warn("Query request failed after attempts: " + (retries + 1) + " - Duration: " + (System.nanoTime() - startTime));
1589+
throw lastException;
15891590
};
15901591

15911592
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
@@ -61,9 +61,9 @@ public enum ClientConfigProperties {
6161

6262
SOCKET_OPERATION_TIMEOUT("socket_timeout", Integer.class, "0"),
6363

64-
SOCKET_RCVBUF_OPT("socket_rcvbuf", Integer.class, "8196"),
64+
SOCKET_RCVBUF_OPT("socket_rcvbuf", Integer.class, "804800"),
6565

66-
SOCKET_SNDBUF_OPT("socket_sndbuf", Integer.class,"8196"),
66+
SOCKET_SNDBUF_OPT("socket_sndbuf", Integer.class,"804800"),
6767

6868
SOCKET_REUSEADDR_OPT("socket_reuseaddr", Boolean.class),
6969

@@ -131,7 +131,7 @@ public enum ClientConfigProperties {
131131

132132
CLIENT_RETRY_ON_FAILURE("client_retry_on_failures", List.class,
133133
String.join(",", ClientFaultCause.NoHttpResponse.name(), ClientFaultCause.ConnectTimeout.name(),
134-
ClientFaultCause.ConnectionRequestTimeout.name())) {
134+
ClientFaultCause.ConnectionRequestTimeout.name(), ClientFaultCause.ServerRetryable.name())) {
135135
@Override
136136
public Object parseValue(String value) {
137137
List<String> strValues = (List<String>) super.parseValue(value);
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)