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

Botocore timeout #629

Closed
wants to merge 13 commits into from
Closed

Botocore timeout #629

wants to merge 13 commits into from

Conversation

nplutt
Copy link
Contributor

@nplutt nplutt commented Dec 5, 2017

Enhancement for issue #344.

Let me know if you would like me to change anything. I decided to go with the option of consuming the timeout value through the cli but I could also see if you want this to be consumed through the config file.

@codecov-io
Copy link

codecov-io commented Dec 5, 2017

Codecov Report

Merging #629 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
+ Coverage   94.96%   94.97%   +0.01%     
==========================================
  Files          18       18              
  Lines        3236     3243       +7     
  Branches      421      422       +1     
==========================================
+ Hits         3073     3080       +7     
  Misses        110      110              
  Partials       53       53
Impacted Files Coverage Δ
chalice/cli/__init__.py 84.92% <100%> (+0.07%) ⬆️
chalice/cli/factory.py 90.82% <100%> (+0.34%) ⬆️
chalice/app.py 97.8% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7ce766...4d49f5d. Read the comment docs.

Copy link
Member

@jamesls jamesls left a comment

Choose a reason for hiding this comment

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

Looks good, just had a suggestion on how you could simplify the code by setting a default client config on the Session object.

EDIT: Looks like I didn't save my previous comment about the default client config. Expanding on my comment above, the botocore.Session has a set_default_client_config() method that allows you to set a default botocore.Config to use for all Session.create_client() calls. What I think we can do to simplify is just update the create_botocore_session() method in the cli factory to accept a new connection_timeout param, which if provided will create a botocore.Config() object and call set_default_client_config() on the Session. That should also mean you won't have to update awsclient.py with the botocore_config object because the session will already be configured with a default client config.

@@ -121,17 +121,27 @@ def run_local_server(factory, host, port, stage, env):
help=('Name of the Chalice stage to deploy to. '
'Specifying a new chalice stage will create '
'an entirely new set of AWS resources.'))
@click.option('--botocore-timeout',
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer we just call this --connection-timeout.

@nplutt
Copy link
Contributor Author

nplutt commented Dec 6, 2017

Hey @jamesls, I made all of the requested changes. Thanks for the review, also good catch on the set_default_client_config() method it really simplified the code!

Copy link
Member

@jamesls jamesls left a comment

Choose a reason for hiding this comment

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

Thanks for updating, looks good to me.

jamesls added a commit that referenced this pull request Dec 6, 2017
PR #629

* nplutt-botocore-timeoue:
  Add --connection-timeout to deploy command
@jamesls
Copy link
Member

jamesls commented Dec 6, 2017

Rebased to a single commit (eafa129) and merged via f091f7d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants