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

implement Wait() on Strategy to fetch remaining errors #179

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

philandstuff
Copy link
Contributor

Currently, we use an errgroup as a semaphore in buffer and consistent hash modes, but we never inspect the results of sem.Wait() to see if there were any errors. This results in errors being swallowed.

This implements Wait(), and uses it everywhere we call Fetch(). Now that we have it, we don't need to store errors on bufferedReader so we can get rid of that.

@philandstuff philandstuff requested a review from a team March 7, 2024 12:26
Currently, we use an errgroup as a semaphore in buffer and consistent hash
modes, but we never inspect the results of sem.Wait() to see if there were any
errors. This results in errors being swallowed.

This implements Wait(), and uses it everywhere we call Fetch().  Now that we
have it, we don't need to store errors on bufferedReader so we can get rid of
that.
@philandstuff philandstuff merged commit c72c384 into main Mar 7, 2024
5 checks passed
@philandstuff philandstuff deleted the wait-for-errors branch March 7, 2024 15:41
tempusfrangit added a commit that referenced this pull request Mar 15, 2024
This reverts commit c72c384.

We cannot add more to the underlying waitgroup in eg after we call
.Wait(). We're calling .Wait() as part of DownloadFile which could in
some cases result in after .Wait() before return additional additions to
the waitgroup. This is surfaced in multifile mode when the multifile
number of buffers is below a critical threshold allowing for the
downloader to begin a second file before the first file completed.

Closes: #188
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.

2 participants