Downloader: fix linear phase hang if saved to fast. (#111)

If a slice is verified and saved too fast,
the next slice monotonic verification aborts.
We can't abort on Saved slices, because they will be evicted,
and so the remaining_count won't change (potentially),
causing the VerifyStageLinearLink to wait forever.

It is fine to abort on Invalid, because they are gonna be redownloaded,
verified internally, and the remaining_count will change.
This commit is contained in:
battlmonstr
2021-12-16 15:52:39 +01:00
committed by GitHub
parent 9563783b97
commit d036ad2b8e

View File

@@ -74,7 +74,7 @@ impl VerifyStageLinearLink {
let next_slice_lock = self.header_slices.try_fold(initial_value, |_, slice_lock| {
let slice = slice_lock.read();
match slice.status {
HeaderSliceStatus::Verified | HeaderSliceStatus::Invalid => {
HeaderSliceStatus::Verified | HeaderSliceStatus::Saved => {
ControlFlow::Continue(None)
}
HeaderSliceStatus::VerifiedInternally => {