`socket_keepalive` doesn't work with shaded clickhouse-jdbc

Open
#3,092 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, linux
Domain
databases

Research direction

Start by reproducing the JDBC property and URL forms on Ubuntu 22.04 with ClickHouse Server 26.7.5.10, then compare socket behavior for the shaded clickhouse-jdbc client. Done means enabling socket_keepalive produces the expected keepalive timer in ss output for the affected client versions.

Written by the indexing model from the issue text.

Description

bug

socket_keepalive doesnt' applied

Steps to reproduce

Note: I would expect that instruction from official site[1] should end up with the same result.

  1. Specify following option for apache/cloudberry-pxf:
      <property>
       <name>jdbc.connection.property.socket_keepalive</name>
       <value>true</value>
      </property>
    
    or in JDBC URL &socket_keepalive=true
  2. expect that SO_KEEPALIVE=true. However it is not.
    Actual:
    # ss -Otnpio state established | grep -F '8123'
    0      0                    [::ffff:10.1.0.9]:44198               [::ffff:10.1.0.20]:8123  users:(("java",pid=2731285,fd=34)) ts sack illinois wscale:10,4 rto:201 rtt:0.343/0.188 <cut>
    
    Expected (spot the timer section!):
    0      0                  [::ffff:10.1.0.29]:15938                 [::ffff:10.1.0.20]:8123  users:(("java",pid=514753,fd=36)) timer:(keepalive,10sec,0) ts sack illinois wscale:10,4 rto:201 rtt:0.249/0.123 <cut>
    
Environment
  • Cloud
  • Client version: 0.9.8 and 0.10.0
  • OS: Ubuntu 22.04
ClickHouse Server
  • ClickHouse Server version: 26.7.5.10
  • CREATE TABLE statements for tables involved:
    SELECT toInt32(sleep(600)) AS slept
    SETTINGS
       function_sleep_max_microseconds_per_block = 600000000,
       max_execution_time = 0
    

[1] https://clickhouse.com/docs/integrations/language-clients/java/jdbc#linux

Dominant language
Java
Stars
1.6k
Forks
637
Avg merge
2d 12h
Merged PRs (30d)
28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ClickHouse/clickhouse-java

All issues in ClickHouse/clickhouse-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.