Add transfer retries and batches#1664
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds retries for transfers, along with the ability to resume partially downloaded files.
Here are the docs:
Retry Behavior
Failed downloads can be retried automatically up to the configured number of attempts. If an attempt fails initially, the application delays the second attempt by the configured delay, and an exponential backoff is used to compute the delay for all subsequent events, up to the configured maximum delay.
By default, partial downloads are resumed based on the size of the incomplete file. Users can choose to always overwrite files if they wish.
YAML
This PR also introduces a
BatchIdcolumn for Transfers, but doesn't do anything with it yet.Testing
I ran another copy of slskd with the following adjustment to the upload code:
This gives uploads a 50% chance of failing each time the governor is asked for a block of bytes, which is every iteration of the send loop. With this in place, I downloaded a directory:
Each file failed and was automatically retried, up to 96 times. I found and fixed a bug with progress reporting in Soulseek.NET here, and with that, everything seems to be working perfectly.
Source files:
Downloaded files: