-
Notifications
You must be signed in to change notification settings - Fork 313
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
fix download from s3/gs by moving http query parameter downstream #1293
fix download from s3/gs by moving http query parameter downstream #1293
Conversation
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.
Thanks for spotting (and fixing) this! The code in the net
module is used for downloads in general, such as downloading ES artifacts but also corpora. The logic of disabling KPI tracking makes sense for ES artifacts but not so much for the rest. May I therefore suggest that we really go with your other proposal of checking for the correct scheme before adding the request parameter? Here is a proposed change:
diff --git a/esrally/utils/net.py b/esrally/utils/net.py
index 4c0a868..7f2ad71 100644
--- a/esrally/utils/net.py
+++ b/esrally/utils/net.py
@@ -194,7 +194,11 @@ def download_http(url, local_path, expected_size_in_bytes=None, progress_indicat
return expected_size_in_bytes
def add_url_param_elastic_no_kpi(url):
- return _add_url_param(url, {"x-elastic-no-kpi": "true"})
+ scheme = urllib3.util.parse_url(url).scheme
+ if scheme.startswith("http"):
+ return _add_url_param(url, {"x-elastic-no-kpi": "true"})
+ else:
+ return url
👍 I missed that this is also used for downloading data files. |
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.
Thanks for the fix! LGTM. Let's wait for CI to finish, then I'll merge this.
Fix a regression from #1159, the added no kpi parameter breaks downloads from s3/gs. The change adds a check of the protocol in
add_url_param_elastic_no_kpi
and only adds the parameter if itshttp