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

BF: Handle IncompleteResultsError in cloning dataset #98

Merged
merged 4 commits into from
Feb 14, 2023

Conversation

candleindark
Copy link
Collaborator

Cloning a dataset sometimes can fail with an IncompleteResultsError. Simply retrying will resolve the problem in most cases.

This PR is only a step toward a solution for #93. A complete solution would require the handling of the case in which all retries of cloning fail. However, with this PR, the population of datasets would be stable enough for the work for #89 to start.

Cloning a dataset sometimes can fail with a
IncompleteResultsError. Simply waiting and
retrying will resolve the problem in most cases
@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Base: 95.43% // Head: 94.54% // Decreases project coverage by -0.90% ⚠️

Coverage data is based on head (95103d6) compared to base (fdf402a).
Patch coverage: 33.33% of modified lines in pull request are covered.

❗ Current head 95103d6 differs from pull request most recent head b0f0dd2. Consider uploading reports for the commit b0f0dd2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
- Coverage   95.43%   94.54%   -0.90%     
==========================================
  Files          26       26              
  Lines        1030     1044      +14     
==========================================
+ Hits          983      987       +4     
- Misses         47       57      +10     
Impacted Files Coverage Δ
datalad_registry/tasks.py 87.12% <33.33%> (-6.95%) ⬇️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

try:
ds = dl.clone(url, ds_path_str)
except IncompleteResultsError:
lgr.warning(f"Incomplete results error in cloning {url}. Trying again.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.unlink(ds_path_str) before retrying to ensure that follow up re-cloning is not somehow skipping since target exists but not fully kosher.

@yarikoptic
Copy link
Member

in the future checkout the tenacity library for generic framework for retries

@yarikoptic yarikoptic merged commit 66f7f8f into datalad:master Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants