-
Notifications
You must be signed in to change notification settings - Fork 247
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
Downloading/encoding concurrency #2172
Conversation
…or future reusability (the change is just a refactoring, no logic changes)
… future reusability (the change is just a refactoring, no logic changes)
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.
Make sense overall, just one nit.
Also, looks like we only concurrently downloading one sector, can it be more than one? or is that out of memory concern of the downloaded sector?
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.
Also, looks like we only concurrently downloading one sector, can it be more than one? or is that out of memory concern of the downloaded sector?
Memory usage will be excessive and generally we expect that downloading will be fast enough for this to not block encoding. With one farm you only download one sector ahead, but with multiple farms and --sector-downloading-concurrency
increased from default value of 2
, each farm can potentially download one sector ahead, but more than one per farm doesn't make a lot of sense and makes implementation tricky in terms of avoiding deadlocks.
This PR aims to resolve #2027 by allowing next sector to be downloaded while the previous sector is being encoded.
All commits before the last one are just refactoring to enable necessary capabilities.
There are a few way to implement this, I decided to simply spawn background task and keep it in a variable to look into later.
As byproduct of refactoring
subspace-farmer-components
has become more flexible, but at the same time previous simple API is still present for convenience.Code contributor checklist: