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 tcp keepalive feature flag to botocore #49

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.9
0.0.10
3 changes: 2 additions & 1 deletion tests/.wickerconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"boto_config": {
"max_pool_connections":10,
"read_timeout_s": 140,
"connect_timeout_s": 140
"connect_timeout_s": 140,
"tcp_keepalive": false
Copy link
Collaborator

Choose a reason for hiding this comment

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

default this to true

}
},
"dynamodb_config": {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_get_column_concatenated_bytes_files_path(self, mock_get_config: mock.Mo
"aws_s3_config": {
"s3_datasets_path": "s3://dummy_bucket/wicker/",
"region": "us-east-1",
"boto_config": {"max_pool_connections": 10, "read_timeout_s": 140, "connect_timeout_s": 140},
"boto_config": {"max_pool_connections": 10, "read_timeout_s": 140, "connect_timeout_s": 140, "tcp_keepalive": False},
},
"dynamodb_config": {"table_name": "fake-table-name", "region": "us-west-2"},
"storage_download_config": {
Expand Down
2 changes: 2 additions & 0 deletions wicker/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ class BotoS3Config:
max_pool_connections: int
read_timeout_s: int
connect_timeout_s: int
tcp_keepalive: bool

@classmethod
def from_json(cls, data: Dict[str, Any]) -> BotoS3Config:
return cls(
max_pool_connections=data["max_pool_connections"],
read_timeout_s=data["read_timeout_s"],
connect_timeout_s=data["connect_timeout_s"],
tcp_keepalive=data["tcp_keepalive"]
)


Expand Down
1 change: 1 addition & 0 deletions wicker/core/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, session: Optional[boto3.session.Session] = None) -> None:
max_pool_connections=boto_config.max_pool_connections,
read_timeout=boto_config.read_timeout_s,
connect_timeout=boto_config.connect_timeout_s,
tcp_keepalive= boto_config.tcp_keepalive
)
self.session = boto3.session.Session() if session is None else session
self.client = self.session.client("s3", config=boto_client_config)
Expand Down
Loading