-
Notifications
You must be signed in to change notification settings - Fork 26
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
Log results of requests.utils.super_len()
when DANDI_DEVEL_INSTRUMENT_REQUESTS_SUPERLEN
is set
#1267
Conversation
…ENT_REQUESTS_SUPERLEN` is set
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1267 +/- ##
==========================================
+ Coverage 89.02% 89.06% +0.03%
==========================================
Files 76 76
Lines 9753 9767 +14
==========================================
+ Hits 8683 8699 +16
+ Misses 1070 1068 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
dandi/files/zarr.py
Outdated
json_resp=False, | ||
retry_if=_retry_zarr_file, | ||
headers={"Content-MD5": item.base64_digest}, | ||
) |
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.
nice design pattern on many aspects!
@asmacdo @candleindark - please review/take into your toolbelt on how to
- add optional context managers to the piece of code without duplication
- instrument/patch some functionality (outside or not) temporarily
@yarikoptic I just realized that this approach will be a disaster, as Zarr entries are uploaded in a thread pool run within another set of threads for parallel asset uploads, yet monkeypatching is process-wide; hence, the patches to |
with this patch to requests diff --git a/requests/utils.py b/requests/utils.py
index a367417f..dc4df067 100644
--- a/requests/utils.py
+++ b/requests/utils.py
@@ -131,6 +131,7 @@ def dict_to_sequence(d):
def super_len(o):
+ print(f"super_len on str={o} repr={o!r}")
total_length = None
current_position = 0
I see
while running our tests -- so either of those (str or repr) would be good enough to identify the location. this way patched function would need only the content which is given to it. |
somehow the run in that instrumented nfs environment resulted in
I didn't check if that is a flaky or whatnot, just restarting for a good check on that |
Ok, green now, let's proceed |
🚀 PR was released in |
Part of #1257.