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
Feature/retry config #5174
Feature/retry config #5174
Conversation
Consider a different name for |
I like the idea, but you are changing the default retry attempts, and that is breaking the behavior. Changing that shouldn't be needed, right? |
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.
I'd prefer another approach for implementing this, what do you think @lasote
@@ -254,6 +255,8 @@ def print_progress(output, units, progress=""): | |||
|
|||
|
|||
def call_with_retry(out, retry, retry_wait, method, *args, **kwargs): | |||
if retry is None: |
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.
I'd prefer a different approach.
As there are arguments existing, use them, and if another value is to be used from the conan.conf, lets inject it much earlier in the call stack, as soon as possible.
In other words, better to have it coming always from argument than having to read another env-var here.
It's needed to detect when the value is forced and when the value is the defaulted one. I agree though that it's better to preserve existing defaults. Will see how to pull extraction up. |
So, I've pulled up the fallback to the config values for the Also, I have a problem with the |
I guess something like #5204? For the tools part. |
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.
Please have a look to those minor comments, and I think it could be merged after that.
Note my comment about |
Docs: conan-io/docs#1295 |
Hi @Minimonium Each conan_api call is wrapped with: with tools.environment_append(api._cache.config.env_vars):
# Patch the globals in tools
return f(*args, **kwargs) So I'd say tools.download usage of env-vars will be fine. |
Merged, will be in next 1.16, many thanks! Check the first 2 lines I added in your first comment:
They are used to automatically generated the changelog each release :) |
Changelog: Feature: Implement conan.conf
retry
andretry-wait
andCONAN_RETRY
andCONAN_RETRY_WAIT
to configure all retries for all transfers, including upload, download, andtools.download()
.Docs: conan-io/docs#1295
Closes #1215
The feature to pull up download/upload
retry
andretry_wait
configuration toconan.conf
and environment variablesCONAN_RETRY
andCONAN_RETRY_WAIT
.By using them as config variables the user can customize the Conan network behaviour specific to the machine in a unified manner instead of defining the flags in each related command.
Parameters of the
upload
command and thetools.download
force override the default values for customizable behaviour.It requires to change the default values of parameters of the
upload
command toNone
, so we'd fall back to the configuration values.Also, because of the unified value system default values are now consistent across the API. Because of that, it's required to change old tests since messages on the default behaviour on retries has changed.
The problem of pushing them via an API for the general download (and related) commands is that we'd need to propagate them all across the codebase:
And it would clutter the code with forwarded parameters which is not really worth it.