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

fix: Disable connection pool as workaround for async runtime hang #474

Merged
merged 2 commits into from
Jul 26, 2022
Merged
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
9 changes: 8 additions & 1 deletion src/io_util/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ pub struct HttpClient(
impl HttpClient {
/// Create a new http client.
pub fn new() -> Self {
HttpClient(hyper::Client::builder().build(hyper_tls::HttpsConnector::new()))
HttpClient(
hyper::Client::builder()
// Disable connection pool to address weird async runtime hang.
//
// ref: https://github.com/datafuselabs/opendal/issues/473
.pool_max_idle_per_host(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it have performance issue if we turn off ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does, but not very seriously.

Most object storage services (like AWS S3, OSS, COS) will use http/2, which has its own connection stream and doesn't need http/1.1's keep-alive.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, aws s3 always returns Connection: close

.build(hyper_tls::HttpsConnector::new()),
)
}
}

Expand Down