Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-494: [Flight] Allow configuring connect timeout in JDBC #495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lidavidm
Copy link
Member

@lidavidm lidavidm commented Jan 9, 2025

Allow configuring the connect timeout via connectTimeoutMs so that the driver doesn't wait so long before giving up on unreachable locations.

Fixes #494.

@lidavidm
Copy link
Member Author

lidavidm commented Feb 7, 2025

@jbonofre are you familiar with the JDBC driver at all?

@jbonofre
Copy link
Member

jbonofre commented Feb 7, 2025

@lidavidm yes a bit. I can take a look on this one.

@jbonofre jbonofre self-requested a review February 7, 2025 15:28
Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

My only comment is that I would expect client cache in another PR as it's a new feature compared to the initial intend of this PR.

public NettyChannelBuilder build() {
final NettyChannelBuilder builder;

switch (location.getUri().getScheme()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I'm investigating the Netty channel address depending of the scheme as it seems we have a weird behavior here.
Your change move that from FlightClient to NettyClientBuilder so it looks good to me.

@@ -47,6 +47,21 @@ under the License.
</exclusions>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we have to explicitly define these dependencies, I thought they came transitively from arrow flight.

@@ -113,6 +114,8 @@ private static ArrowFlightSqlClientHandler createNewClientHandler(
.withRetainCookies(config.retainCookies())
.withRetainAuth(config.retainAuth())
.withCatalog(config.getCatalog())
.withClientCache(config.useClientCache() ? new FlightClientCache() : null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a new feature (client caching), right ? It's ok in the PR but it looks a big "unrelated" to the PR title 😄

@lidavidm
Copy link
Member Author

lidavidm commented Mar 6, 2025

Thanks, I can split up this PR into 3? parts if that would be better.

This comment has been minimized.

@jbonofre
Copy link
Member

jbonofre commented Mar 7, 2025

@lidavidm no, that's OK. I was just a bit confused because the change seems larger than just the PR title. But it's OK, I'm fine with that. I will do a new review pass. Thanks !

@lidavidm
Copy link
Member Author

lidavidm commented Mar 7, 2025

It's probably better for the changelog if I split it up so no worries! Thanks!

@lidavidm lidavidm changed the title GH-494: [Flight] Improve handling of unreachable locations in JDBC GH-494: [Flight] Allow configuring connect timeout in JDBC Mar 7, 2025
@lidavidm
Copy link
Member Author

lidavidm commented Mar 7, 2025

Ok, I've cut this down to just the connect timeout option. I'll follow up with a third PR to add back the basic client cache. (There's yet another issue for adding a full client cache.)

@lidavidm lidavidm added the enhancement PRs that add or improve features. label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that add or improve features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flight] JDBC driver: make connect timeout adjustible
2 participants