-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
to Config object
#2766
Conversation
Codecov ReportBase: 95.25% // Head: 95.25% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #2766 +/- ##
========================================
Coverage 95.25% 95.25%
========================================
Files 62 62
Lines 12899 12900 +1
========================================
+ Hits 12287 12288 +1
Misses 612 612
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me. I added a few small suggestions in the inline comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can you double check what is causing the codecov to report a decrease in coverage? I can't figure out a way to see the affected files in their UI, so this might require generating two reports for before and after locally...
ead666d
to
effe086
Compare
effe086
to
a79e9d0
Compare
* release-1.27.84: Bumping version to 1.27.84 Update to latest endpoints Update to latest models add `tcp_keepalive` to Config object (#2766)
Thanks for working on this! I spent some time to try and see how a client instance could expose the value back to the caller, but it seems like no matter what, it'll always return import boto3
from botocore.config import Config
# No setting set in either config file or Config object
client = boto3.client("dynamodb")
print(client.meta.config.tcp_keepalive)
# None
# Pass in explicitly to enable
client = boto3.client("dynamodb", config=Config(tcp_keepalive=True))
print(client.meta.config.tcp_keepalive)
# None Is there another way to access the property, or is that this value is not being persisted to the Config object returned? Line 123 in 409b404
I can confirm (via interactive debugger) that the file loader still ends up on |
The `tcp_keepalive` parameter was added to the Config object in boto#2766 When inspecting the return value of an instantiated Client's `meta` with the config, it is always `None`. Does not handle resolving whether the value has been set in `scoped_config`.
@miketheman thanks for flagging this! I did a little bit of digging and this should be a one line fix. I'll touch base internally with my team about this just to make sure we want to expose this in the new config object that gets constructed in import boto3
from botocore.config import Config
cfg = Config(tcp_keepalive=True)
client = boto3.client('s3', config=cfg)
print(client._endpoint.http_session._socket_options)
[(6, 1, 1), (65535, 8, 1)] |
@miketheman sweet! That's exactly the change I was thinking of thank you for working on it. I'll be speaking with my team this afternoon, but assuming we're set, I can approve it and we can get it merged ASAP. |
The `tcp_keepalive` parameter was added to the Config object in #2766 When inspecting the return value of an instantiated Client's `meta` with the config, it is always `None`. Does not handle resolving whether the value has been set in `scoped_config`.
thanks @dlm6693 and @miketheman my team is dealing with this exact issue right now and getting an official fix in place would be mega helpful |
@HayesData Sorry to hear you're hitting this issue! An "official fix" is already in place with this change since version 1.27.84 - the change allows setting the desired configuration via Like @dlm6693 posted a little earlier, you can update your client creation to account for the configuration already, like so: import boto3
from botocore.config import Config
cfg = Config(tcp_keepalive=True) # here's the important bit!
s3_client = boto3.client('s3', config=cfg)
s3_client.... |
This PR partially addresses #2249. We have chosen not to incorporate
duration_seconds
as it is a pretty niche, rarely used argument that also relies on others to be set in the same config object. Becausetcp_keepalive
is a setting that originates from an operating system, it can only ever be enabled not disabled. This means if set in a scoped config, but not the client config object, it will still be enabled.