Skip to content

Commit

Permalink
Make read timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed May 16, 2024
1 parent 12de973 commit 97e62d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions medusa-example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ use_sudo_for_restore = True

;aws_cli_path = <Location of the aws cli binary if not in PATH>

; Read timeout in seconds for the storage provider.
;read_timeout = 60

[monitoring]
;monitoring_provider = <Provider used for sending metrics. Currently either of "ffwd" or "local">

Expand Down
5 changes: 3 additions & 2 deletions medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
['bucket_name', 'key_file', 'prefix', 'fqdn', 'host_file_separator', 'storage_provider',
'base_path', 'max_backup_age', 'max_backup_count', 'api_profile', 'transfer_max_bandwidth',
'concurrent_transfers', 'multi_part_upload_threshold', 'host', 'region', 'port', 'secure', 'ssl_verify',
'aws_cli_path', 'kms_id', 'backup_grace_period_in_days', 'use_sudo_for_restore', 'k8s_mode']
'aws_cli_path', 'kms_id', 'backup_grace_period_in_days', 'use_sudo_for_restore', 'k8s_mode', 'read_timeout']
)

CassandraConfig = collections.namedtuple(
Expand Down Expand Up @@ -116,7 +116,8 @@ def _build_default_config():
'fqdn': socket.getfqdn(),
'region': 'default',
'backup_grace_period_in_days': 10,
'use_sudo_for_restore': 'True'
'use_sudo_for_restore': 'True',
'read_timeout': 60
}

config['logging'] = {
Expand Down
3 changes: 2 additions & 1 deletion medusa/storage/s3_base_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def connect(self):
region_name=self.credentials.region,
signature_version='v4',
tcp_keepalive=True,
max_pool_connections=max_pool_size
max_pool_connections=max_pool_size,
read_timeout=self.config.read_timeout,
)
if self.credentials.access_key_id is not None:
self.s3_client = boto3.client(
Expand Down

0 comments on commit 97e62d7

Please sign in to comment.