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

Make it easier to set metadata_service_num_attempts and metadata_service_timeout programatically #2561

Open
sirosen opened this issue Aug 26, 2020 · 3 comments
Labels
feature-request This issue requests a feature. p3 This is a minor priority issue

Comments

@sirosen
Copy link

sirosen commented Aug 26, 2020

Right now, it's hard to set metadata_service_num_attempts and metadata_service_timeout in application code.
Whereas some settings are trivial to set on a per-client basis (e.g. region=...), some require a layer of indirection (e.g. via creating a custom Config object).

However, in the case of these parameters, I think the shortest path to setting these in my application would be something like

def boto3_session(**kwargs):
    botocore_session = botocore.session.get_session()
    botocore_session.set_config_variable('metadata_service_timeout', 5)
    botocore_session.set_config_variable('metadata_service_num_attempts', 2)
    return boto3.session.Session(botocore_session=botocore_session, **kwargs)

This is verbose and awkward for setting something which is supported in config and environment variables.
And it requires that all client instantiations use explicit session objects in order to set a config flag.

I think my ideal solution would be for botocore.config.Config to support these settings, and then for the boto3 clients to pass them through the underlying session machinery so that these are supported as part of the retry config.

If these are already supported via Config, then I would claim that the current documentation does not make this sufficiently clear, and ask that we enhance it to cover this usage. (I'm happy to open a PR with sufficient direction about where to update things.)
Even if this is something which is considered primarily a botocore issue, I think the boto3 docs should explain how to set these values.

@sirosen sirosen added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Aug 26, 2020
@swetashre swetashre self-assigned this Aug 27, 2020
@swetashre
Copy link
Contributor

Thank you for your post. Marking this as feature request.

@swetashre swetashre removed the needs-triage This issue or PR still needs to be triaged. label Nov 10, 2020
@swetashre swetashre assigned kdaily and unassigned swetashre Mar 25, 2021
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 25, 2022
@sirosen
Copy link
Author

sirosen commented Mar 28, 2022

The auto-close happening over a 3-day period is a little short, especially as I wasn't working on Friday. Can this be reopened? There's been no activity because I don't want to nag -- I assume the original issue is clear and sufficient.

@tim-finnigan tim-finnigan reopened this Mar 28, 2022
@aBurmeseDev aBurmeseDev added p3 This is a minor priority issue and removed closed-for-staleness labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

5 participants