Skip to content
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
5 changes: 3 additions & 2 deletions cloud/src/recycler/s3_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ std::shared_ptr<Aws::Auth::AWSCredentialsProvider> S3Accessor::get_aws_credentia
return std::make_shared<Aws::Auth::InstanceProfileCredentialsProvider>();
}

Aws::Client::ClientConfiguration clientConfiguration;
Aws::Client::ClientConfiguration clientConfiguration =
S3Environment::getClientConfiguration();
if (_ca_cert_file_path.empty()) {
_ca_cert_file_path =
get_valid_ca_cert_path(doris::cloud::split(config::ca_cert_file_paths, ';'));
Expand Down Expand Up @@ -363,7 +364,7 @@ int S3Accessor::init() {
uri_ = normalize_http_uri(uri_);

// S3Conf::S3
Aws::Client::ClientConfiguration aws_config;
Aws::Client::ClientConfiguration aws_config = S3Environment::getClientConfiguration();
aws_config.endpointOverride = conf_.endpoint;
aws_config.region = conf_.region;
// Aws::Http::CurlHandleContainer::AcquireCurlHandle() may be blocked if the connecitons are bottleneck
Expand Down
10 changes: 10 additions & 0 deletions cloud/src/recycler/s3_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ class S3Environment {

static S3Environment& getInstance();

static Aws::Client::ClientConfiguration& getClientConfiguration() {
// The default constructor of ClientConfiguration will do some http call
// such as Aws::Internal::GetEC2MetadataClient and other init operation,
// which is unnecessary.
// So here we use a static instance, and deep copy every time
// to avoid unnecessary operations.
static Aws::Client::ClientConfiguration instance;
return instance;
}

~S3Environment();

private:
Expand Down
Loading