ClickHouse / ClickHouse/clickhouse-java

Socket closed

オープン
#1,787 コメント 13 件 リアクション 1 件 担当者 0 名 GitHub で見る
area:network client-api-v2 investigating
主要言語
Java
スター
1.6k
フォーク
636
平均マージ
2日 23時間
マージ済み PR(30日)
29

説明

### Describe the bug
This happens intermittently every now and then.

### Expected behaviour
Error when processing batch of inserts, the list doesn't contain more than 1000 items.

### Code example
```
var statement = connection.createStatement(INSERT);

for (Iterator iterator = items.iterator(); iterator.hasNext();) {
var item = iterator.next();

statement.bind("id", item.id())
.bind("itemId", datasetId)
.bind("input", item.input().toString())
.bind("source", item.source().getValue());

if (iterator.hasNext()) {
statement.add();
}
}

statement.fetchSize(items.size());

return statement.execute();
}
```

### Error log
```
! java.net.ConnectException: Socket closed
! at com.clickhouse.client.http.ApacheHttpConnectionImpl.post(ApacheHttpConnectionImpl.java:276)
! at com.clickhouse.client.http.ClickHouseHttpClient.send(ClickHouseHttpClient.java:195)
! at com.clickhouse.client.AbstractClient.sendAsync(AbstractClient.java:161)
! at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:273)
! ... 4 common frames omitted
! Causing: com.clickhouse.client.ClickHouseException: Socket closed
! at com.clickhouse.client.ClickHouseException.of(ClickHouseException.java:149)
! at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:275)
! at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
! at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
! at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
! ... 1 common frames omitted
! Causing: reactor.core.Exceptions$ReactiveException: com.clickhouse.client.ClickHouseException: Socket closed
! at reactor.core.Exceptions.propagate(Exceptions.java:408)
! at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:101)
! at reactor.core.publisher.Mono.block(Mono.java:1728)
```
### Configuration
#### Environment
* Client version: 0.6.4
* Language version: Java 21
* OS: MAC

#### ClickHouse server
* ClickHouse Server version: :23.8.15.35-alpine

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the stack-trace entry points in ApacheHttpConnectionImpl.java, ClickHouseHttpClient.java, and AbstractClient.java. Reproduce the intermittent failure using the shown batch-insert example with no more than 1000 items, then trace when the HTTP socket closes. Done means the failure is explained and covered by a regression test or a documented limitation.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, database
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。