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

download: more consistent and exhaustive logging, new DANDI_DEVEL_AGGRESSIVE_RETRY mode, respect (?) Retry-After #1509

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

yarikoptic
Copy link
Member

It was originally developed as part of the PR but derailed into fixing/robustifying download functionality. So sits on top of

TODOs

  • make sure testing passes (added test revealed some odd behavior on Windows)
  • possibly fold in here fixup for download to do full file checksumming if download was resumed

Also shortened the log line to not include traceback
not sure why was not failing for me locally but fails on CI
That is my guess for what is happening in

    ________________________ test_DownloadDirectory_basic _________________________
    dandi\tests\test_download.py:1048: in test_DownloadDirectory_basic
        with DownloadDirectory(tmp_path, digests={}) as dl:
    dandi\download.py:889: in __exit__
        self.writefile.replace(self.filepath)
    C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\pathlib.py:1247: in replace
        self._accessor.replace(self, target)
    E   PermissionError: [WinError 5] Access is denied: 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_DownloadDirectory_basic0.dandidownload\\file' -> 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_DownloadDirectory_basic0'
Very unlikely but it could be that directory already existed but without
checksum file for some reason.
no v prefix since is not providing any information on top; sorting for deterministic order
…IVE_RETRY mode

This is all to address that odd case with 000026 where connection keeps interrupting.
Unclear why so adding more specific cases handling and allowing for such an aggressive
retrying where we would proceed as long as we are getting something (but sleep would also increase)
@yarikoptic yarikoptic added minor Increment the minor version when merged cmd-download labels Sep 27, 2024
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 70.90909% with 32 lines in your changes missing coverage. Please review.

Project coverage is 62.35%. Comparing base (fdd65d0) to head (bfb73c0).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
dandi/download.py 35.55% 29 Missing ⚠️
dandi/cli/command.py 0.00% 1 Missing ⚠️
dandi/dandiapi.py 80.00% 1 Missing ⚠️
dandi/tests/test_download.py 98.30% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (fdd65d0) and HEAD (bfb73c0). Click for more details.

HEAD has 14 uploads less than BASE
Flag BASE (fdd65d0) HEAD (bfb73c0)
unittests 17 3
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1509       +/-   ##
===========================================
- Coverage   88.56%   62.35%   -26.22%     
===========================================
  Files          78       78               
  Lines       10585    10684       +99     
===========================================
- Hits         9375     6662     -2713     
- Misses       1210     4022     +2812     
Flag Coverage Δ
unittests 62.35% <70.90%> (-26.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd-download minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant