ClickHouse / ClickHouse/clickhouse-java

[jdbc-v2, client-v2] MAX_NUM_OF_CONNECTIONS doesn't limit connection.

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

説明

## Description
There was an issue https://github.com/ClickHouse/clickhouse-java/issues/1705
The problem still exists: https://github.com/ClickHouse/clickhouse-java/issues/1705#issuecomment-2898237536

> Hi @Paultagoras, I have taken some new tests - I tried to re-run both my old tests and the project @f1llon provided - with clickhouse-jdbc version 0.8.6 and using JDBC-v2 classes (for example DataSourceImpl instead of the old ClickHouseDataSource).
On one hand, I don't see anymore the Hikari CP issue I first submitted, so many thanks! But on the other hand, I still have some issues:

> running @f1llon 's test project, I still have the old logs "route allocated: 1 of N; total allocated: 1 of N"
using the "default" connection pool and running my own tests of concurrent reading, property ClientConfigProperties.HTTP_MAX_OPEN_CONNECTIONS is ignored: when I run a netstat command on my PC, the number of connections opened toward ClickHouse can be well above the one I set with the ClientConfigProperties.HTTP_MAX_OPEN_CONNECTIONS property.

> Is it enough to initialize my DataSourceImpl with
baseProperties.setProperty(ClientConfigProperties.HTTP_MAX_OPEN_CONNECTIONS.getKey(), "5");
and then use
datasource.getConnection()
to make this configuration effective or do I need to do anything else?

> Still, thank you for your help!

### Steps to reproduce
1.
2.
3.
### Error Log or Exception StackTrace

```
```

### Expected Behaviour

### Code Example

```java

```

### Configuration

#### Client Configuration
```java

```

#### Environment
* [ ] Cloud
* Client version:
* Language version:
* OS:

#### ClickHouse Server
* ClickHouse Server version:
* ClickHouse Server non-default settings, if any:
* `CREATE TABLE` statements for tables involved:
* Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary

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

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

調査の方向性

Start at DataSourceImpl and trace how ClientConfigProperties.HTTP_MAX_OPEN_CONNECTIONS is used when datasource.getConnection() is called. Reproduce the concurrent-reading scenario and inspect the connection allocation behavior. Done means the configured maximum is enforced and covered by a focused regression test.

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

評価

技術スタック
java
領域
database
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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