GH-577: Use JVM proxy settings in Netty client - #1027
Conversation
This comment has been minimized.
This comment has been minimized.
|
As I'm close to release Arrow Java 19.0.0, I will consider this PR for 20.0.0. |
|
@jbonofre yeah that makes sense, this one is still a draft as I have not finished work on it, I will ping you once I finish the PR. Should be ready in the next couple of days. |
ef9e0c5 to
1e44df0
Compare
|
While the fix was in the Let me know if it's worth it to expand the testing surface with a unit test closer to the place of the bug fix. |
|
Can we rebase? It seems CI did not trigger |
1e44df0 to
dcfa5ef
Compare
|
It seems all workflows time out here, even after a retry. |
|
@lidavidm Thanks for the ping. I rebased all PRs. |
Do you guys need help with the CI? I was going to look into some CI stuff on Arrow Go, but given that we have a release here I can jump in before I move to that. Edit- I synced with JB and I saw that he is already on it. I'll continue with the protocol change implementation in other languages to have feature parity. |
|
Well, other PRs are passing fine. Perhaps something in this PR may be related? |
dcfa5ef to
18b30dd
Compare
|
I tracked this down all the way to grpc-java and IMO the root cause is there, my change in this PR surfaced the problem. The situation looks a bit involved. I can create some PRs in Arrow Java to gain some robustness over these lower level errors in time for this release, or we can leave this PR for a later release. I have no strong opinion either way, but I do have bandwidth to tackle at least one of these right now. If you are interested @lidavidm and @jbonofre let me know and I'll start work on this. Improvements we could have in the JDBC driver:
Details about the root cause (no need to read this unless you're interested in the gRPC internals): 1- I changed the NettyChannelBuilder call from forAddress(SocketAddress) to forAddress(String, int). This allows us to respect JVM proxy settings and is the overload gRPC recommends for normal TCP channels. I will take this up with the gRPC folks and see if they agree that we need to propagate the exception there. In any case that will be too slow for this release. |
|
Thanks for digging into it. I think we should do the validation here, and implement the timeout and follow up with grpc-java separately. |
|
@lidavidm I'll add the port validation in this PR later today. I think that makes sense as it both unblocks the PR and it is my change here that removed the fail-fast validation. I created a couple issues for the JDBC connection timeouts: #1267 #1268 I'll grab them once I finish here, I already familiarized myself with the relevant code yesterday. I think it's fine to leave them for a later release though. I'll also follow-up with gRPC (and try to provide a PR there if they agree that the problem is on their side). Thanks for the guidance! |
What's Changed
The Flight SQL JDBC driver ignored JVM proxy settings (
-Dhttps.proxyHost,-Dhttps.proxyPort). Connections would always go directly to the target host, bypassing any configured proxy.Switched to
NettyChannelBuilder.forAddress(host, port)for the TCP-based schemes. This causes gRPC to go throughProxySelector, which picks up the standard JVM proxy properties.Are these changes tested?
Yes.
Added a test to
ConnectionTestthat installs a recordingProxySelectoras the JVM default, opens a JDBC connection, and asserts thatProxySelector.select()was called. This directly validates that the driver participates in JVM proxy detection without requiring a real proxy server.This change was created with AI assistance (Claude Code). All lines were manually reviewed by a human. The output is not copyrightable subject matter.
Closes #577.