Skip to content

[client-v2] Resource release #2649

Open
Open

Description

@chernser

Description

Recently we have found that while using queryRecords leads to error when user forget to close Records object what leads to a connection leaking. We need to review and put some guard rails even this a misuse problem.

We need to:

  • Think about detecting orphan response objects somehow
  • We need to put more information into ConnectionRequestTimeoutException because it indicates that pool is empty
  • We need to review Insert/Command operation code to make sure resource are release as soon as they can.

Activity

  1. added this to the 0.9.5 milestone on Nov 7, 2025
  2. added theissue type on Nov 7, 2025
  3. added
    client
    on Nov 7, 2025
  4. modified the milestones: 0.9.5, 0.9.6 on Jan 6, 2026
  5. modified the milestones: 0.9.6, 0.9.7 on Jan 21, 2026
  6. modified the milestones: 0.9.7, 0.9.8 on Feb 23, 2026
  7. modified the milestones: 0.9.8, 0.9.9 on Mar 16, 2026
  8. added this to the 0.9.9 milestone on Apr 15, 2026
  9. chernser commented on Jun 1, 2026

    @chernser
    ContributorAuthor

    Triage
    There are operations like execute and insert that do not need to read from response body. Once data is sent by user only confirmation is needed. Client gets this confirmation at the end of request or when server sends headers. Task here is to close in/out and release connection.
    HTTP transport is problematic at this case because server response can be at the end of data transfer (if there is not much data) or at the middle of transfer when server responded but data still poured into output stream. Client controls request from its side but has nothing about data transfer as it is done by client. The only identification is that output stream is closed.

  10. modified the milestones: 0.10.0, 0.11.0 on Jun 2, 2026
  11. modified the milestones: 0.11.0, 0.12.0 on Sep 23, 2026
  12. removed this from the 0.12.0 milestone on Oct 14, 2026
  13. polyglotAI-bot commented on Nov 28, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Keep open — feature needed
    The third item is done on main: insert and execute release their connection before they return. The first two items still need work: detect a Records or QueryResponse that the caller does not close, and make the pool timeout error say that the pool is empty.

    Analysis: client-v2 has no check for a response that the caller does not close (no Cleaner or finalizer in client-v2/src/main). A pool timeout becomes a ConnectionInitiationException with the generic request message (HttpAPIClientHelper.java:1233). It is retried by default (ClientConfigProperties.java:231), and each retry quarantines the endpoint and logs "All endpoints are non-responsive" (ClientNodeSelector.java:50, :58), so the log points to the server, not to the pool. insert closes the response before it returns (Client.java:1655, :1883), and CommandResponse closes its QueryResponse in the constructor (CommandResponse.java:17).

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

  14. added
    connectivity
    on Nov 28, 2026
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

    clientconnectivityenhancement

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions