Skip to content

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

Description

@chernser

Description

There was an issue #1705
The problem still exists: #1705 (comment)

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

Error Log or Exception StackTrace

Expected Behaviour

Code Example

Configuration

Client Configuration

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 if necessary

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions