Skip to content

Thread safety of client-v2 Client #2845

Open
Open

Description

@sanzh-m

Documentation for client-v2 never explicitly states that Client class is thread-safe or not. From code it appears to be thread-safe, but it would be very useful to have an official confirmation on whether the same Client object can be reused across threads or it should be created per thread.

Activity

  1. changed the title [-]Documentation for client-v2 never explicitly states that Client class is thread-safe or not. From code it appears to be thread-safe, but it would be very useful to have an official confirmation on whether the same Client object can be reused across threads or it should be created per thread.[/-] [+]Thread safety of client-v2 Client[/+] on Apr 28, 2026
  2. chernser commented on May 1, 2026

    @chernser
    Contributor

    @sanzh-m thank your for the question!

    It has no specific answer because not all parts of client are thread-safe because of optimization.
    We will work on documenting different aspects of how to use client by multi threads.

  3. added
    documentation
    client
    jdbc
    on May 1, 2026
  4. added this to the 0.12.0 milestone on Jul 22, 2026
  5. removed this from the 0.12.0 milestone on Nov 10, 2026
  6. polyglotAI-bot commented on Nov 27, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Keep open — docs update needed
    Publish a thread-safety statement for Client on the clickhouse.com Java client pages, with the parts that are not thread-safe (maintainer comment of 2026-05-01), and make the repo docs agree with the Javadoc (Analysis).

    Analysis: docs/integration-client.md:140 (added 2026-11-05) says that each Client instance is thread-safe, and the Javadoc at Client.java:122 names one exception, the global authentication configuration. docs/authentication.md:25 calls the credential updates thread-safe, but the Javadoc at Client.java:2690 says that they are not thread-safe with respect to other credential updates or concurrent requests. No document says that a reader is for one thread only (Client.java:997).

    Automated triage by Polyglot AI. A maintainer makes the final decision.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientdocumentationjdbc

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions