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

Default connection and request timeouts of 5 seconds #4928

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Oct 13, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

Infinite timeouts are surprising and can result in workloads hanging with no obvious cause.

This also configures a very low connection timeout for the metadata endpoint, to provide fast feedback should it be being erroneously used in an environment that doesn't support it

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the object-store Object Store Interface label Oct 13, 2023
pub(crate) fn metadata_client(&self) -> Result<Client> {
self.clone()
.with_allow_http(true)
.with_connect_timeout(Duration::from_secs(1))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will help new users who may use the crate without configuring any credentials, which will then default to the metadata credentials, which will then hang indefinitely trying to get credentials from a non-existent metadata endpoint

@tustvold tustvold force-pushed the default-client-timeouts branch from 7fc8ed9 to e61a38d Compare October 13, 2023 11:00
proxy_excludes: None,
allow_http: Default::default(),
allow_insecure: Default::default(),
timeout: Some(Duration::from_secs(5).into()),
Copy link
Contributor

@crepererum crepererum Oct 13, 2023

Choose a reason for hiding this comment

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

Since there are with_{connection_}timeout methods that accepts Duration but not None, maybe add two new methods with_infinite_{connection_}timeout and with clear doc warnings? Otherwise there is no public way to set these options to None. If you NEVER want anyone to set this to None, then this shouldn't be an Option.

@tustvold tustvold merged commit 31bc84c into apache:master Oct 16, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants