Skip to content

Configurable http client timeouts for alioss/gcs/s3 - #156

Open
jochenehret wants to merge 4 commits into
mainfrom
configurable_timeouts
Open

Configurable http client timeouts for alioss/gcs/s3#156
jochenehret wants to merge 4 commits into
mainfrom
configurable_timeouts

Conversation

@jochenehret

Copy link
Copy Markdown
Contributor

No description provided.

@stephanme

Copy link
Copy Markdown
Member

Is the new http_client_timeout a global timeout used e.g. for the complete blob upload/download?

For fog, the default excon timeouts were (see https://github.com/excon/excon/blob/master/README.md#timeouts-and-retries):

  • connect timeout: default 60s
  • read timeout: default 60s
  • write timeout: default 60s
  • global timeout for the complete request: default none

@jochenehret
jochenehret marked this pull request as draft August 13, 2026 11:43
* allow configuration of http client timeouts
* if nothing is configured, no http client timeout applies
@jochenehret
jochenehret force-pushed the configurable_timeouts branch from d972924 to ec839ff Compare August 13, 2026 13:46
@jochenehret

Copy link
Copy Markdown
Contributor Author

To give some more context: These are the current Golang default settings:

Go's http.DefaultClient / http.DefaultTransport has:
net.Dialer.Timeout: 30s
net.Dialer.KeepAlive: 30s
TLSHandshakeTimeout: 10s
Everything else: not set

This is sufficient to detect dead TCP connections and closely resembles the behavior of the old Fog/excon libraries.

This PR allows the configuration of http client request timeouts to detect slow or unresponsive http servers. Note that large blobs are chunked in smaller fragments and the request timeout applies to one chunk. The sizes depend on the hyperscaler SDK used.

Comment thread gcs/config/config.go
if requestTimeout <= 0 {
return 0, ErrNonPositiveHTTPRequestTimeout
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No round up check in here as in alioss config

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GCS uses time.Duration directly, which supports sub-second precision.

Comment thread s3/config/config.go
if httpRequestTimeout <= 0 {
return 0, errorNonPositiveHTTPRequestTimeout
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No round up check in here as in alioss config

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

S3 uses time.Duration directly, which supports sub-second precision.

Comment thread s3/config/config.go

if _, err := strconv.ParseFloat(c.HTTPRequestTimeout, 64); err == nil {
return 0, fmt.Errorf("invalid http_request_timeout: missing duration unit")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess this check should be also in other clients config

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

S3 and GCS use time.ParseDuration which catches wrong formats. Alioss is different and expects full seconds as int64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants