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

Core, Rest: Enable useSystemProperties on RESTClient #11548

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

munendrasn
Copy link
Contributor

  • When useSystemProperties on the httpClient, it reads the proxy settings if not configured explicitly from system properties.
  • Introduce new rest client property enable or disable consuming systemProperty

cc @danielcweeks @amogh-jahagirdar @nastra

@github-actions github-actions bot added the core label Nov 14, 2024
@munendrasn
Copy link
Contributor Author

@amogh-jahagirdar @nastra could you please take look?

@nastra
Copy link
Contributor

nastra commented Nov 25, 2024

@munendrasn can you please add some details why this functionality is needed? Having more and more configuration flags just makes it quite complicated for users

@munendrasn
Copy link
Contributor Author

@nastra

Agreed on having more configuration flags.. The original intent was to enable useSystemProperties on HttpClient too as mentioned in the Description. This would help in consuming the Java system properties directly for cases like Http Proxy, or keepLive configuration

Reasoning for introducing new configuration property to enable or disable usingSystemProperties :
One sample usecase, where we need to connect to Different RESTCatalog impl
One of the impl requires mTLS connection and other doesn't. We specify trustStore and keyStore impl via Java System properties
We would like to consume these systemProperties in one case but not the other case.. hence, configuration property

@nastra
Copy link
Contributor

nastra commented Nov 25, 2024

We would like to consume these systemProperties in one case but not the other case.. hence, configuration property

What about not setting these system properties in the second use case?

@munendrasn
Copy link
Contributor Author

What about not setting these system properties in the second use case?

We access both catalogs in same process/job.. a case of custom catalog federation

@munendrasn
Copy link
Contributor Author

Should I consider splitting the changes into different PR.. ie, enabling the systemProperties on the client and making usage of system properties configurable through property

@munendrasn
Copy link
Contributor Author

@nastra @danielcweeks could you please review this?

@nastra
Copy link
Contributor

nastra commented Dec 12, 2024

I'm really hesitant to introduce a flag to control whether things get read from system properties or not. Let's wait for feedback from @danielcweeks

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 12, 2025
@github-actions github-actions bot removed the stale label Jan 14, 2025
Copy link
Collaborator

@gaborkaszab gaborkaszab left a comment

Choose a reason for hiding this comment

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

I saw some hesitance in the comments whether to have this change or not. I don't have a strong opinion myself, but for me it seems that since the HttpClientBuilder already has this option we just make it possible to use it for Iceberg's HTTP clients, so would make sense in a way. So if there are users wanting to use it, they would have it.
What I found is that with the current proposal we seem to change the default to use system props. I don't think we should do that, let's keep the defaults as they are now.

@@ -82,6 +82,8 @@ public class HTTPClient implements RESTClient {
static final int REST_MAX_CONNECTIONS_DEFAULT = 100;
static final String REST_MAX_CONNECTIONS_PER_ROUTE = "rest.client.connections-per-route";
static final int REST_MAX_CONNECTIONS_PER_ROUTE_DEFAULT = 100;
private static final String REST_USE_SYSTEM_PROPERTIES = "rest.client.use-system-properties";
private static final boolean REST_USE_SYSTEM_PROPERTIES_DEFAULT = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm not mistaken the current behaviour doesn't use system properties. With this change we seem to change that behaviour and one would have to turn that off manually by setting a property to false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

systemProperties are used for ConnectionManager but not on Client. Not sure, what would the ideal behaviour in this case.

@munendrasn
Copy link
Contributor Author

@nastra Created another PR with possible alternative solution #11979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants