-
Notifications
You must be signed in to change notification settings - Fork 69
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: Release downloader lock before re-attempting fallback download #938
Conversation
@baszalmstra @wolfv @nichmor Hey folks! After updating rattler I saw our setup where the conda packages have zip descriptors start to fail downloads. Put up this quick fix for it :) |
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.
Do you think it makes sense to add an additional function to the reporter or an argument to download complete to signal this case? I can imagine this can be important for reporters.
@baszalmstra what would we want to do with this extra method/argument? We already have the
message which is very visible. |
Sure thats for users, but I can imagine that a Reporter doesnt expect a download to be completed twice. If we add an additional parameter to the function we can tell the reporter that a download failed and it could handle the completion of the second properly. |
@baszalmstra In this flow, the sequence Currently, when calling rattler/crates/rattler_cache/src/package_cache/mod.rs Lines 449 to 457 in 8bb8835
This inner reporter seems to do something for the visual progress bar: rattler/crates/rattler/src/install/installer/indicatif.rs Lines 608 to 629 in 8bb8835
I understand the proposition of trying to change from
to
However, it will be pretty hard (and possibly mess up existing logic) to get rid of the second https://github.com/conda/rattler/b Also, visually, I even with this existing logic it all looked completely fine to me. I didn't notice any strangeness. |
Ah I didnt understand correctly then! It was my understanding that download start was only called once! But in that case it should be fine. |
Description
In #837 locking logic was added to the download reporter to prevent multiple downloads.
This was clashing with the logic added in #797 where, if we detect we're trying to download a zip that has data descriptors, we fallback to doing a full download and interrupt the streaming decompression download.
The issue comes from us not releasing the lock before attempting the second download, hitting this line
rattler/crates/rattler_cache/src/package_cache/mod.rs
Line 439 in 8bb8835
As a fix, we report the previous download as completed before attempting the second one! Have verified in my custom setup that this works.