Skip to content

[Java][Flight] Add caching of FlightClients to JDBC #157

Open

Description

@jduo

Describe the enhancement requested

When getFlightInfo reports a list of endpoints, the driver internally creates a FlightClient for each endpoint that reports a Location. These clients can benefit from being cached/pooled since a server will likely re-use endpoints for subsequent queries. This should likely be a configuration option.

The driver should also check if the Location at an endpoint is the same as the original location used when calling getFlightInfo and avoid creating a new FlightClient in this case.

Investigate using https://github.com/ben-manes/caffeine for caching.

Component(s)

FlightRPC, Java

Activity

  1. transferred this issue fromapache/arrowon Nov 26, 2024
  2. self-assigned this
    on Jan 8, 2025
  3. lidavidm commented on Jan 8, 2025

    @lidavidm
    Member

    I'm going to take a look at this. Another issue that's cropped up is that if the server returns an endpoint that isn't addressible (e.g. the data servers are in the cloud and the client is talking to the control plane via proxy), then the client hits the full 30 second Netty connect timeout on every attempt.

  4. lidavidm commented on Jan 8, 2025

    @lidavidm
    Member

    If we could cache failed attempts and avoid them on subsequent attempts that would help with this (along with caching existing clients and configuring the timeout).

  5. removed their assignment
    on Jan 9, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions