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

Add S3 http2 toggle flag #604

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nativelink-config/src/stores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,16 @@ pub struct S3Store {
/// Default: false
#[serde(default)]
pub insecure_allow_http: bool,

/// Disable http/2 connections and only use http/1.1. Default client
/// configuration will have http/1.1 and http/2 enabled for connection
/// schemes. Http/2 should be disabled if environments have poor support
/// or performance related to http/2. Safe to keep default unless
/// underlying network environment or S3 API servers specify otherwise.
///
/// Default: false
#[serde(default)]
pub disable_http2: bool,
}

#[allow(non_camel_case_types)]
Expand Down
6 changes: 5 additions & 1 deletion nativelink-store/src/s3_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ impl TlsConnector {
connector_with_roots.https_only()
};

let connector = connector_with_schemes.enable_http1().enable_http2().build();
let connector = if config.disable_http2 {
connector_with_schemes.enable_http1().build()
} else {
connector_with_schemes.enable_http1().enable_http2().build()
};

Self {
connector,
Expand Down