-
Notifications
You must be signed in to change notification settings - Fork 9
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 timeout environment variable, fix make test examples in CONTRIBUTION.md #110
Conversation
The result can be tested like this:
Run with default timeout:
Run with 2 second timeout:
|
@@ -70,5 +73,6 @@ def _get_client_required_versions( | |||
url_mds_versions, | |||
params=construct_query_params_for_marine_data_store_monitoring(), | |||
proxies=session.proxies, | |||
timeout=COPERNICUSMARINE_GET_TIMEOUT, |
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 would rather have it in the copernicusmarine/core_functions/sessions.py
when the session is initialised so that if the request is reused somewhere it has the same timeout
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 thought that was impossible, but there seems to be a way, https://stackoverflow.com/questions/41295142/is-there-a-way-to-globally-override-requests-timeout-setting Will add.
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 think the retries set at session level are causing problems.
get_configured_requests_session
sets Retry(total=5, backoff_factor=1
causing these times:
root@08ad85780a2a:/app# export COPERNICUSMARINE_CONNECTION_TIMEOUT=1
root@08ad85780a2a:/app# time copernicusmarine describe
real 0m38.225s
root@08ad85780a2a:/app# export COPERNICUSMARINE_CONNECTION_TIMEOUT=3
root@08ad85780a2a:/app# time copernicusmarine describe
real 0m50.229s
So when the connections time out, it will retry with longer and longer sleeps, thus using much more than my intention.
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.
Yeah but it makes sense though as the retry should be triggered for a connection timeout 🤔 at least it's not hanging for ever
Pushing a new version, but haven't tested yet. Will do before the day is over. |
…r setting global timeouts.
…r setting global timeouts to subset command.
0d6bd7a
to
772f358
Compare
Closing this as it will be released for v2 and has been done here: #146 |
Closes #109